Results 1 to 2 of 2

Thread: gcc (linux) : ok ; g++ (windows) : fails

  1. #1
    Join Date
    Feb 2006
    Posts
    26
    Thanked 2 Times in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default gcc (linux) : ok ; g++ (windows) : fails

    Hi,

    I've got a little issue porting my app (Qt4.1) under window.
    All works fine while I'm compiling under linux (gcc4 ; kdevelop ; qt 4.1) but I've got compilation error trying to compile the SAME sources under windows (g++, Qt 4.1).

    The error seems to be coming while the linking phase, and only for QTcpSocket class :

    I've got that kind of g++ command :

    Qt Code:
    1. g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -D
    2. QT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include/Qt3Support" -I"C:/Qt/4.1.0/include" -I"."
    3. -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"." -I"C:/Qt/4.1.0/mkspecs/win32-g++" -o release\moc_p2mroom.o release\moc_p2mroom.cpp
    4. C:\Qt\4.1.0\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT
    5. -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include/Qt3Support" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/i
    6. nclude/ActiveQt" -I"release" -I"." -I"C:/Qt/4.1.0/mkspecs/win32-g++" -D__GNUC__ -DWIN32 p2muser.h -o release\moc_p2muser.cpp
    To copy to clipboard, switch view to plain text mode 

    and the following errors :

    Qt Code:
    1. ./release\p2mircconnexion.o(.text+0x70):p2mircconnexion.cpp: undefined reference to `_imp___ZN10QTcpSocketC1EP7QObject'
    2. ./release\p2mircconnexion.o(.text+0x242):p2mircconnexion.cpp: undefined reference to `QTcpSocket::~QTcpSocket()'
    3. ./release\p2mircconnexion.o(.text+0x2dc):p2mircconnexion.cpp: undefined reference to `_imp___ZN10QTcpSocketC1EP7QObject'
    4. ./release\p2mircconnexion.o(.text+0x4b2):p2mircconnexion.cpp: undefined reference to `QTcpSocket::~QTcpSocket()'
    5. ./release\p2mircconnexion.o(.text+0x586):p2mircconnexion.cpp: undefined reference to `QTcpSocket::~QTcpSocket()'
    6. ./release\p2mircconnexion.o(.text+0x644):p2mircconnexion.cpp: undefined reference to `QTcpSocket::~QTcpSocket()'
    7. ./release\p2mircconnexion.o(.text+0x6f6):p2mircconnexion.cpp: undefined reference to `QTcpSocket::~QTcpSocket()'
    8. ./release\p2mircconnexion.o(.text+0x7b4):p2mircconnexion.cpp: undefined reference to `QTcpSocket::~QTcpSocket()'
    9. ./release\p2mircconnexion.o(.text+0x866):p2mircconnexion.cpp: more undefined references to `QTcpSocket::~QTcpSocket()' follow
    10. ./release\p2mircconnexion.o(.text+0x9d0):p2mircconnexion.cpp: undefined reference to `_imp___ZNK15QAbstractSocket5stateEv'
    11. ./release\p2mircconnexion.o(.text+0xab0):p2mircconnexion.cpp: undefined reference to `_imp___ZN15QAbstractSocket5flushEv'
    12. ./release\p2mircconnexion.o(.text+0xbd9):p2mircconnexion.cpp: undefined reference to `_imp___ZN15QAbstractSocket13connectToHostERK7QStringt6QFlagsIN9QIODevice12
    13. OpenModeFlagEE'
    14. ./release\p2mircconnexion.o(.text+0xcd1):p2mircconnexion.cpp: undefined reference to `_imp___ZN15QAbstractSocket5flushEv'
    15. ./release\p2mircconnexion.o(.text+0xceb):p2mircconnexion.cpp: undefined reference to `QAbstractSocket::close()'
    16. ./release\p2mircconnexion.o(.text+0xd3c):p2mircconnexion.cpp: undefined reference to `_imp___ZNK15QAbstractSocket5stateEv'
    17. ./release\p2mircconnexion.o(.text+0x95b9):p2mircconnexion.cpp: undefined reference to `QAbstractSocket::canReadLine() const'
    18. collect2: ld returned 1 exit status
    19. mingw32-make[1]: *** [release\src.exe] Error 1
    20. mingw32-make[1]: Leaving directory `D:/DOCUME~2/PROGRA~1/FREECO~1/FREECO~1.QT4/src'
    21. mingw32-make: *** [release] Error 2
    To copy to clipboard, switch view to plain text mode 

    Any idea ?

  2. #2
    Join Date
    Feb 2006
    Posts
    26
    Thanked 2 Times in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: gcc (linux) : ok ; g++ (windows) : fails

    Sorry for my stupid question ; everything works fine now :

    I missed the 'QT += network' directive in my project file

Similar Threads

  1. Qt Jambi, deploying app on Mac & Windows fails
    By ChrisColon in forum Installation and Deployment
    Replies: 2
    Last Post: 16th February 2009, 22:05
  2. Replies: 5
    Last Post: 15th January 2009, 09:03
  3. Opening text file fails after autostartup on windows
    By yogourta in forum Qt Programming
    Replies: 2
    Last Post: 18th October 2008, 03:52
  4. QPalette works differently on windows and linux
    By babu198649 in forum Newbie
    Replies: 3
    Last Post: 6th March 2008, 07:27
  5. Qt 4.1.2 Fails to build on Linux
    By rohandhruva in forum Installation and Deployment
    Replies: 6
    Last Post: 16th April 2006, 21:44

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.