Results 1 to 4 of 4

Thread: ld error

  1. #1
    Join Date
    Jul 2008
    Posts
    48
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default ld error

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: ld error

    Can you show your code?
    Do you use QCoreApplication or QApplication?

  3. #3
    Join Date
    Jul 2008
    Posts
    48
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: ld error

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: ld error

    Then use QCoreApplication, otherwise you don't have an event loop.
    It will probably will get rid of your error as well.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  2. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.