PDA

View Full Version : ld error



afflictedd2
23rd November 2008, 23:20
Hi everyone,

I'm trying to make a simple program to write to file, using Qt but without Gui in a Windows Vista platform. However, when I try to make, I get these errors? Can someone give me some clues on what they mean?

Thanks in advance,

Ted.

C:\Users\Viper\Documents\Tmp\WriteFile>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/Viper/Documents/Tmp/WriteFile'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt
/4.4.3/include/QtCore' -I'c:/Qt/4.4.3/include/QtCore' -I'c:/Qt/4.4.3/include/QtG
ui' -I'c:/Qt/4.4.3/include/QtGui' -I'c:/Qt/4.4.3/include' -I'.' -I'c:/Qt/4.4.3/i
nclude/ActiveQt' -I'debug' -I'.' -I'c:/Qt/4.4.3/mkspecs/default' -o debug/writef
ile.o writefile.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug/WriteFile.exe debug/writefile.o
-L'c:/Qt/4.4.3/lib' -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
c:/Qt/4.4.3/lib/libqtmaind.a(qtmain_win.o)(.text+0x460): In function `WinMain':
C:/Qt/4.4.3/src/winmain/qtmain_win.cpp:134: undefined reference to `qMain(int, c
har**)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug/WriteFile.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Users/Viper/Documents/Tmp/WriteFile'
mingw32-make: *** [debug] Error 2

high_flyer
24th November 2008, 10:06
Can you show your code?
Do you use QCoreApplication or QApplication?

afflictedd2
24th November 2008, 20:38
No, I don't actually user QCoreApplication or QApplication in my code at all.
I don't have it with me right now, but it's a simple main that creates a file with QFile.

I'll post it when I get a hold of it.

Thanks,

Ted.

high_flyer
25th November 2008, 10:01
Then use QCoreApplication, otherwise you don't have an event loop.
It will probably will get rid of your error as well.