PDA

View Full Version : Qt4+SDL on Windows



protoman
25th November 2008, 11:24
Hi, I need some help with a game I'm creating.
The idea is that it does have an editor and a game-engine, the editor is Qt and the game itself SDL, so, to make things easier, I've used some Qt variables and wanted to use those in the game (SDL) program, plus using Qt Creator that is a awesome tool.

But, on Windows only, I'm having problems when linking the program:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o ..\bin\rockman_engine.exe debug/PaintArea.o debug/main.o debug/gdbmacros.o debug/moc_PaintArea.o debug/qrc_application.o -L"c:\Qt\QtCreator\qt\lib" -lmingw32 -lqtmaind -L./lib -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL -lQtGuid4 -lQtNetworkd4 -lQtCored4
c:\Qt\QtCreator\qt\lib/libqtmaind.a(qtmain_win.o): In function `WinMain':
C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.4.3/src/winmain/qtmain_win.cpp:134: undefined reference to `qMain(int, char**)'
collect2: ld returned 1 exit status

Here is my project:
SOURCES += PaintArea.cpp main.cpp
TEMPLATE = app
CONFIG += warn_on thread qt
TARGET = rockman_engine
DESTDIR = ../bin
QT += gui
HEADERS += PaintArea.h game.h game_sdl_common.h SDL/SDL.h
RESOURCES = application.qrc
unix:LIBS += -L/usr/X11R6/lib -lX11 -lSDL_mixer -lSDL_image -lSDL_ttf `sdl-config --libs`
win32:LIBS += -L./lib -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL

The whole app sources (it is still in early stages, to it's small) can be found at:
http://rockman-engine.svn.sourceforge.net/

Any help is appreciated, thanks :)