I'm trying to use SDL 2.0 in Qt Creator 3.1, using the Qt Build Suite (QBS) in Windows 7.
I've put the links in my .qbs to locate the SDL folders and I think everything works ok, because in my main.cpp it's recognizing the SDL functions, trying to autocomplete them.
The problem is, whenever I try to compile, I get the 'undefined reference to WinMain@16'
I'm using MinGW and set in the Compiler preferences the linker flags to: -lmingw32 -lSDL2main -lSDL2 -mwindows
The output is:
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/libmingw32.a(main.o): In function `main':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/crt/main.c:91: undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
And my .qbs is:
import qbs 1.0
CppApplication {
name: "testeSDL2"
cpp.includePaths: [".",
"C:/SDL2-2.0.3/i686-w64-mingw32/include"]
cpp.libraryPaths: [
"C:/SDL2-2.0.3/i686-w64-mingw32/lib"]
cpp.dynamicLibraries: "SDL2"
files: [
"main.cpp"
]
qbsSearchPaths: "C:/CppLibs/"
}
I've been searching a lot and only find answers for common Qt projects using the .pro but not the .qbs... And there's a section in the SDL site that says it's a linker problem, but I set them in the preferences window, my guess is that I also need to set them somehow in the .qbs file, but I don't have a clue on how to do so. Can anyone help?