Results 1 to 3 of 3

Thread: Linking problems with QT4 under Windows

  1. #1
    Join Date
    Sep 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Linking problems with QT4 under Windows

    Hi guys,

    Our application runs in both Linux and Windows. The stable release at the moment uses QT3, however one of my colleagues has been porting it from QT3 to QT4 in Linux. He still has some issues to iron out, but has managed to at least get it to compile and start up.

    I have to do the same for Windows, of course because we use SVN most of his changes are in effect and work appropriately. I installed QT4.4 on my Windows machine, set up the environment variables manually (I previously had QT3 installed, thus my QT variables were set for QT3), and proceeded to work on the port.

    The application takes the form of 2 projects - one produces a library, the other produces an application, which relies on the library produced by the first project. I have succeeded in getting the first project (the library) to compile. The second project does compile, but then fails at linking. I have tried everything I know and simply cannot get linking to succeed. All of the linker errors relate to QT4 - I dont see any that relate to the library. There are a total of 419 linker errors, but most of them are the same, thus I will post a select few. Please let me know if I should post a detailed log elsewhere (it will be very long).

    1>GM.lib(moc_GMPointEdit.obj) : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QLineEdit::staticMetaObject" (?staticMetaObject@QLineEdit@@2UQMetaObject@@B)

    1>qui.lib(database.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall QDataBrowser::setSqlCursor(class QSqlCursor *,bool)" (?setSqlCursor@QDataBrowser@@UAEXPAVQSqlCursor@@_N @Z)

    1>GM.lib(GMCGFXScriptCommand.obj) : error LNK2001: unresolved external symbol "private: static class QTextCodec * QString::codecForCStrings" (?codecForCStrings@QString@@0PAVQTextCodec@@A)

    1>main.obj : error LNK2001: unresolved external symbol "private: static class QCoreApplication * QCoreApplication::self" (?self@QCoreApplication@@0PAV1@A)

    We use the QT3Support libraries, as some of our classes have not been fully ported yet. I am compiling using Visual Studio 2005 SP1 running on Windows XP SP2. We also make use of various other libraries, including but not limited to Ruby, opengl, some nvidia libraries and mysql. I have tried adding every library in the QT4 libs directory (not that this is a debug build), as well as the QT3 main lib (just in case). They do not solve the unresolved external symbols.

    Any help would be appreciated, please let me know if there is any further information I can provide.

  2. #2
    Join Date
    Aug 2006
    Posts
    163
    Thanks
    12
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Linking problems with QT4 under Windows

    In the projects options in Visual Studio, have you added the ${QTDIR}\lib directory to the Library settings of the Active Configuration? Or alternatively, set it globally using the global options of Visual Studio? In Visual Studio 9 2008 it is Tools->Options->Projects and Solutions->VC++ Directories, and then select Library Files in the combobox for "Show directories for:"
    You should also set up the Include Files while there as well.

  3. #3
    Join Date
    Sep 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Linking problems with QT4 under Windows

    I've already done that - both adding ($QTDIR)\lib and adding the correct folders to the Show Directories for pages for the include files, source code, and libraries.

Similar Threads

  1. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 15:52
  2. Qt 4.3 static linking on Windows
    By john_crichton in forum Installation and Deployment
    Replies: 2
    Last Post: 13th May 2008, 07:57
  3. Problems building mysql plugin for Qt 4.1.2 on windows XP
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2006, 16:38
  4. Problems with threads and windows
    By SkripT in forum Qt Programming
    Replies: 15
    Last Post: 16th January 2006, 18:46

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.