so basicly i want to make a new sdl2 project (lastest version : 2.24.2) so i make a simple program that just print out the version of sdl :
#include <stdio.h>
#include "SDL2/SDL.h"
#undef main
int main(int argc, char **argv) {
SDL_version nb;
SDL_GetVersion(&nb);
printf("sdl version %d.%d.%d", nb.major, nb.major, nb.patch);
return 0;
}
and i'm using this command to compile :
gcc src/*.c -o bin/sampleSDL -I include -L lib -lmingw32 -lSDL2main -lSDL2
and i get error :
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\CDRIC~1\AppData\Local\Temp\ccaOMh5N.o:main.c:(.text+0x16): undefined reference to `SDL_GetVersion'
collect2.exe: error: ld returned 1 exit status
I use the 32bits version too.
also my project have this structure :
SampleSDLproject
|-bin
| |-SDL2.dll
| |-sdl2-config
|
|-include
| |-SDL2
| | |-the headers of sdl
|
|-lib
| |-like the sdl lib folder
|
|-src
| |-main.c
i tried installing some other c/c++ packages for mingw, installing new version of sdl (started with 2.24.1) but all this didn't worked
oh and i was forced to instal endian.h because of vscode
I found the error myself, i just needed to use the i686-w64-mingw32
folder instead of x86_64-w64-mingw32