Results 1 to 1 of 1

Thread: QT4.8.3+Windows Static Libs Building Project problem

  1. #1
    Join Date
    Jan 2013
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QT4.8.3+Windows Static Libs Building Project problem

    I know this question was asked 1 milion times but none actually ever solved what I am looking for or posted FULL explanation how to (even was reading sites on Russian).
    I have rebuild QT using <QTDIR>\configure -static -other-options
    someone else mentioned several times that I need to change qmake settings, someone else also said I need to change mkspecs...
    so I've was changing everything they said (which I guess is stupidest thing, but I need to link static libs to one project no excuse, or bye bye QT from that project).
    rebuilt 2 times QT and resolved all MS linker errors, but I am stuck with QT linker errors constantly.

    What I have done is following:
    - rebuilt QT statically (was not clearing with nmake hoping I can reuse dynamic linking for other projects, should I clear?)
    - set project to include static libraries
    - set ignoring MSVC runtime libs to resolve linker problems (2 errors were there, that symbol is already defined)
    - Hit rebuild and got only QT LINKING ERRORS (have no warnings at all, only errors full list follows):

    Qt Code:
    1. 1>DicomDirBrowser.obj : error LNK2001: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A)
    2. 1>MedicalImageViewer.obj : error LNK2001: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A)
    3. 1>vdicom.obj : error LNK2001: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A)
    4. 1>vreports.obj : error LNK2001: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A)
    5. 1>DicomDirBrowser.obj : error LNK2001: unresolved external symbol "private: static class QCoreApplication * QCoreApplication::self" (?self@QCoreApplication@@0PAV1@A)
    6. 1>main.obj : error LNK2001: unresolved external symbol "private: static class QCoreApplication * QCoreApplication::self" (?self@QCoreApplication@@0PAV1@A)
    7. 1>DicomDirBrowser.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QApplication::staticMetaObject" (?staticMetaObject@QApplication@@2UQMetaObject@@B)
    8. 1>DicomDirBrowser.obj : error LNK2001: unresolved external symbol "public: static struct QListData::Data QListData::shared_null" (?shared_null@QListData@@2UData@1@A)
    9. 1>MedicalImageViewer.obj : error LNK2001: unresolved external symbol "public: static struct QListData::Data QListData::shared_null" (?shared_null@QListData@@2UData@1@A)
    10. 1>vreports.obj : error LNK2001: unresolved external symbol "public: static struct QListData::Data QListData::shared_null" (?shared_null@QListData@@2UData@1@A)
    11. 1>DicomDirBrowser.obj : error LNK2001: unresolved external symbol "public: static char * QSqlDatabase::defaultConnection" (?defaultConnection@QSqlDatabase@@2PADA)
    12. 1>vdicom.obj : error LNK2001: unresolved external symbol "private: static class QTextCodec * QString::codecForCStrings" (?codecForCStrings@QString@@0PAVQTextCodec@@A)
    13. 1>vreports.obj : error LNK2001: unresolved external symbol "private: static class QTextCodec * QString::codecForCStrings" (?codecForCStrings@QString@@0PAVQTextCodec@@A)
    14. 1>moc_DicomDirBrowser.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QWidget::staticMetaObject" (?staticMetaObject@QWidget@@2UQMetaObject@@B)
    15. 1>moc_MedicalImageViewer.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QWidget::staticMetaObject" (?staticMetaObject@QWidget@@2UQMetaObject@@B)
    16. 1>moc_vreports.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QWidget::staticMetaObject" (?staticMetaObject@QWidget@@2UQMetaObject@@B)
    17. 1>moc_MainWindow.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QMainWindow::staticMetaObject" (?staticMetaObject@QMainWindow@@2UQMetaObject@@B)
    18. 1>moc_vreports.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QTreeWidget::staticMetaObject" (?staticMetaObject@QTreeWidget@@2UQMetaObject@@B)
    To copy to clipboard, switch view to plain text mode 

    And after this I have absolutely no idea.
    Normally I usually simply include static libs and set project setting to compile with /MT instead of /MD and everything works fine (maybe few tweaks from time to time, but nothing like this).

    Can someone please point me to COMPLETE tutorial how to rebuild QT to static lib for successful building of msvs2008 apps.
    Also it would be nice to have both dynamic and static versions side by side if someone have posted HOT TO somewhere.


    PS: I can restore full QT original installation (zipped everything before this mess).

  2. The following user says thank you to sa for this useful post:


Similar Threads

  1. Problem building Qt project
    By almo in forum Newbie
    Replies: 3
    Last Post: 10th August 2012, 04:37
  2. building a static lib with links to other static libs
    By hubipet in forum Installation and Deployment
    Replies: 0
    Last Post: 20th October 2011, 18:13
  3. Replies: 3
    Last Post: 18th February 2010, 16:43
  4. jom / Windows SDK libs linking problem
    By nooky59 in forum Qt Tools
    Replies: 3
    Last Post: 12th November 2009, 14:58
  5. problem with static building
    By mismael85 in forum Qt Programming
    Replies: 11
    Last Post: 28th March 2008, 20:43

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.