I\'m trying to set up a C++ project that builds on MinGW and uses SDL. When i try to compile my program, g++ says undefined reference to \'SDL_Function\'
for each S
Try to change the sequence of the input params:
I've stumbled over this before (on Linux):
This call produces an error:
g++ $(pkg-config --cflags --libs sdl2) sdl2test.cpp
sdl2test.cpp:(.text+0x11): undefined reference to `SDL_Init'
sdl2test.cpp:(.text+0x20): undefined reference to `SDL_GetError'
sdl2test.cpp:(.text+0x34): undefined reference to `SDL_Quit'
This works:
g++ sdl2test.cpp $(pkg-config --cflags --libs sdl2)
I changed the sequence of the input parameters and it worked, put SDL2main before SLD2.