Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Link errors on a statically build Qt application
Forum Updated to NodeBB v4.3 + New Features

Link errors on a statically build Qt application

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 3 Posters 7.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nitin777
    wrote on last edited by
    #1

    i have statically configured version of qt.
    when i try to build my application using these statically linked libs,i get these errors.

    @error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::~QString(void)" (_imp??1QString@@QAA@XZ) referenced in function "public: class QString __cdecl CHMIAbout::GetCopyrightMessage(void)" (?GetCopyrightMessage@CHMIAbout@@QAA?AVQString@@XZ)
    1>HMIAbout.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::QString(class QString const &)" (_imp??0QString@@QAA@ABV0@@Z) referenced in function "public: class QString __cdecl CHMIAbout::GetCopyrightMessage(void)" (?GetCopyrightMessage@CHMIAbout@@QAA?AVQString@@XZ)
    1>HMIAbout.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::QString(char const *)" (_imp??0QString@@QAA@PBD@Z) referenced in function "public: class QString __cdecl CHMIAbout::GetCopyrightMessage(void)" (?GetCopyrightMessage@CHMIAbout@@QAA?AVQString@@XZ)@

    do anyone know how to fix this.

    nitin

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      this is a bit less information.
      Can you please show us your project file.
      And you are 100% sure, you have a Qt build for static linkage and that version is used?

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nitin777
        wrote on last edited by
        #3

        i am not exactly sure about the Qt static build.On static build i got these errors.

        @QtGuid.lib(qimagereader.obj) : error LNK2019: unresolved external symbol "public: static bool __cdecl QGifHandler::canRead(class QIODevice *)" (?canRead@QGifHandler@@SA_NPAVQIODevice@@@Z) referenced in function "class QImageIOHandler * __cdecl createReadHandlerHelper(class QIODevice *,class QByteArray const &,bool,bool)" (?createReadHandlerHelper@@YAPAVQImageIOHandler@@PAVQIODevice@@ABVQByteArray@@_N2@Z)
        1>QtGuid.lib(qimagereader.obj) : error LNK2019: unresolved external symbol "public: __cdecl QGifHandler::QGifHandler(void)" (??0QGifHandler@@QAA@XZ) referenced in function "class QImageIOHandler * __cdecl createReadHandlerHelper(class QIODevice *,class QByteArray const &,bool,bool)" (?createReadHandlerHelper@@YAPAVQImageIOHandler@@PAVQIODevice@@ABVQByteArray@@_N2@Z)
        1>QtGuid.lib(qimagewriter.obj) : error LNK2001: unresolved external symbol "public: __cdecl QGifHandler::QGifHandler(void)" (??0QGifHandler@@QAA@XZ)
        1>QtGuid.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol getenv referenced in function jinit_memory_mgr
        1>....\bin\qmlviewer.exe : fatal error LNK1120: 3 unresolved externals@

        i used this to configure

        @configure -platform win32-msvc2008 -xplatform wince60un20-mipsiv_fp-msvc2008 -opensource -release -qt-libjpeg -qt-gif -qt-libpng -no-qt3support -no-phonon -no-phonon-backend -xmlpatterns -exceptions -arch windowsce -nomake examples -nomake demos -static@

        is there any other changes to be done to the qmake.conf and project settings.??

        nitin

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          Hi nitin777, gif could be in an imageplugin, I'm not 100% sure. so perhaps, you need that plugin for static binding. I never tried static binding with MSVC compiler.

          You could search the Qt source for where the QGifHandler class is.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • P Offline
            P Offline
            ppckiller
            wrote on last edited by
            #5

            I've got the similar error while linking my projetc with Qt in a static way.
            After 2 hours to understand the reason of the error. I found that the cause was because the directive Q_CORE_EXPORT should not be define with __declspec(dllexport). So to solve the problem I used the declaration of QT_NODLL. I've passed -DQT_NODLL to the compilator of my makefile. After the compilation was ok

            1 Reply Last reply
            0
            • P Offline
              P Offline
              ppckiller
              wrote on last edited by
              #6

              I've got the similar error while linking my projetc with Qt in a static way.
              After 2 hours to understand the reason of the error. I found that the cause was because the directive Q_CORE_EXPORT should not be define with __declspec(dllexport). So to solve the problem I used the declaration of QT_NODLL. I've passed -DQT_NODLL to the compilator of my makefile. After the compilation was ok

              1 Reply Last reply
              0
              • ? This user is from outside of this forum
                ? This user is from outside of this forum
                Guest
                wrote on last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • ? This user is from outside of this forum
                  ? This user is from outside of this forum
                  Guest
                  wrote on last edited by
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved