Question

Run into a recent issue whilst trying to compile SDL2 with QtCreator using MinGW. It seems that for some reason the libraries are not linking. I know 100% that the libraries are in the correct place, as you can see in this picture: enter image description here

And how i'm linking in my .pro file:

##Windows
win32 {
TEMPLATE = app
CONFIG -= app_bundle
CONFIG -= qt

##Debug & Release Mode Configs
CONFIG(debug, debug|release) {
        CONFIG += console
} else {
        CONFIG -= console
}

INCLUDEPATH += "C:\Users\Daniel\Desktop\SDL2-devel-2.0.0-mingw\SDL2-2.0.0\x86_64-w64-mingw32\include\SDL2"
LIBS += -L"C:\Users\Daniel\Desktop\SDL2-devel-2.0.0-mingw\SDL2-2.0.0\x86_64-w64-mingw32\lib" \
        -lmingw32 \
        -lSDL2 \
        -lSDL2main \
        -lSDL2_ttf \
        -lSDL2_image \
        -lSDL2_mixer \
        -lopengl32
}

Edit: Well I was building with the wrong version of the libs! Doh! But a new problem arises, which i think has something to-do with SDLmain.. Must be missing something in my .pro file but totally unsure what :S enter image description here

Was it helpful?

Solution

Well solved it. Link for any future reference; http://www.cplusplus.com/forum/beginner/110753/

-lSDL2main needs to be before -lSDL2. Dammit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top