Compiling SDL2 Application on Windows 7 32bit + MinGW/Msys |
Compiling SDL2 Application on Windows 7 32bit + MinGW/Msys |
gabomdq
|
Can you try running mingw32-g++ -static -O2 -Wall `sdl2-config --cflags` -I./include -lSDL2_ttf -lopengl32 -lglu32 application.cpp event.cpp exceptions.cpp thread.cpp window.cpp -o sdlui `sdl2-config --libs` That is with the SDL2 libraries at the end of the command line, if you updated MingW32 recently it's possible they've switched GCC versions and the dependency solving "feature/bug" is causing those unresolved symbols. -- Gabriel. |
|||||||||||||||
|
Compiling SDL2 Application on Windows 7 32bit + MinGW/Msys |
MrOzBarry
|
That gives me a bunch of different errors, but it does link to SDL:
Not sure how to fix this either, but we're moving in the right direction -Alex On Sat, Aug 11, 2012 at 1:20 PM, Gabriel Jacobo wrote:
|
|||||||||||||||||||
|
Compiling SDL2 Application on Windows 7 32bit + MinGW/Msys |
gabomdq
|
2012/8/11 Alex Barry
The solution is to start rearranging your command so libraries that depend on others appear first (in a left to right order) in the command line... So, as SDL2_ttf depends on SDL2, you'd put it first. After SDL2 you'd put opengl32 because SDL2 will be using it,etc. It may be even possible you'll need to list a library twice. -- Gabriel. |
|||||||||||||||
|
Compiling SDL2 Application on Windows 7 32bit + MinGW/Msys |
MrOzBarry
|
Just a note to other people who come across this thread, what I ended up doing was reverting to an older version of gcc and g++ by doing the following in the msys shell:
$ mingw-get install gcc-v3-core $ mingw-get install gcc-v3-c++ Note: This will change the default gcc version on your system - if you want to return to gcc 4.x (I think the names may change in the eventual future of gcc 5.x), do: $ mingw-get install gcc-core $ mingw-get install gcc-c++ Then, I was originally trying to build a static library, which was still giving me issues in gcc 3.x, so I tried building with -shared rather than -static, and everything built fine. Gabriel, thanks for the troubleshooting - I've been doing a lot of windows development for work lately and haven't touched gcc in a while. I'm sort of surprised at how messed up the linker is in gcc 4.5.x, but maybe that's intentional in some sense? I don't know, but anyway, thanks for the help! Hope that helps someone else down the road, too, -Alex On Sat, Aug 11, 2012 at 3:42 PM, Gabriel Jacobo wrote:
|
|||||||||||||||||
|