mingw and SDL2 |
Re: mingw and SDL2 |
mbabuskov
|
FWIW, here's a one-liner I use to compile my SDL2 stuff with MinGW:
g++ -mwindows -o game.exe *.cpp -ISDL2 -lmingw32 -lSDL2main -lSDL2 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lSDL2_image -lSDL2_ttf -lfreetype -lBox2D -Llibs HTH |
|||||||||||
|
vastrolorde
|
Quite a lot of libaries you have there. although i dont know whatm ost of them are. My code is nut much different, except for fewer libaries.
Error message:
|
|||||||||||||
|
mbabuskov
|
Are you sure that you are linking in the .o file created from .c or .cpp file that has a valid main() function? |
|||||||||||||||
|
vastrolorde
|
Played around with make file so i got to new error message. I get the feeling, that makeing the .cpp files into .o there is somekind of problem, or maybe where i make it into libary the SDL doesent get included.
Current makefile:
My main file
|
|||||||||||||||||
|
vastrolorde
|
SDL wiki says to chekc if sdl-config follows my source on command line
So i added sdl-config --cflags --libs to my command and i got somekind of weird location
So could it be its looking to the wrong place? |
|||||||||||||||
|
mbabuskov
|
Most probably. I never install SDL with MinGW. Instead I just keep it in a custom directory, so that I can have multiple versions of SDL available at the same time. When compiling, I use -I and -L to point to those directories (for .h and .a files respectively). |
|||||||||||||||||
|
vastrolorde
|
Well this is for school project and we have to use mingw. But i got it working. Problem was i had but 64 bit binaries instead of 32 bit binaries and mingw didnt like them.
My final makefile to anyone who is interested
|
|||||||||||||
|