Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-66419

WIN64: 'undefined reference to `__imp__ZN14QPatternistSDK...' and 'unresolved external symbol "__declspec(dllimport) public: static class QPatternistSDK::TestSuite...' errors for static QtXmlPatterns tests build using mingw-w64 and MSVC

    XMLWordPrintable

    Details

    • Commits:
      4c0244d23dd77958902acd3f29c7540aeb772f83

      Description

      Hello, everyone,

       

      Got errors for builds using mingw-w64:

      mingw32-make[5]: Entering directory 'c:/libQT-5.11-dev/build/qtxmlpatterns/tests/auto/xmlpatternsdiagnosticsts'
      g++ -Wl,-s -mthreads -static -Wl,-subsystem,console -o release\tst_xmlpatternsdiagnosticsts.exe .obj/release/tst_xmlpatternsdiagnosticsts.o .obj/release/TestFundament.o .obj/release/tst_suitetest.o .obj/release/tst_xmlpatternsdiagnosticsts_plugin_import.o .obj/release/moc_tst_suitetest.o  -LC:\libQT-5.11-dev\build\qtxmlpatterns\lib C:\libQT-5.11-dev\build\qtxmlpatterns\lib\libQtXmlPatternsSDK.a -LC:\libQT-5.11-dev\build\qtbase\lib -LC:\libICU-61.1-dev\GCC64RT\lib -LC:\libOPENSSL-1.1.1-dev\GCC64RT\lib C:\libQT-5.11-dev\build\qtbase\lib\libQt5Gui.a -lgdi32 -lcomdlg32 -loleaut32 -limm32 C:\libQT-5.11-dev\build\qtbase\lib\libqtlibpng.a C:\libQT-5.11-dev\build\qtbase\lib\libqtharfbuzz.a -LC:\libQT-5.11-dev\build\qtbase\plugins\bearer C:\libQT-5.11-dev\build\qtbase\plugins\bearer\libqgenericbearer.a C:\libQT-5.11-dev\build\qtxmlpatterns\lib\libQt5XmlPatterns.a C:\libQT-5.11-dev\build\qtbase\lib\libQt5Network.a -ldnsapi -liphlpapi -lcrypt32 C:\libOPENSSL-1.1.1-dev\GCC64RT\lib\libssl.dll.a C:\libOPENSSL-1.1.1-dev\GCC64RT\lib\libcrypto.dll.a C:\libQT-5.11-dev\build\qtbase\lib\libQt5Xml.a C:\libQT-5.11-dev\build\qtbase\lib\libQt5Test.a C:\libQT-5.11-dev\build\qtbase\lib\libQt5Core.a -lmpr -lnetapi32 -luserenv -lversion -lws2_32 -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lwinmm -lz -lsicuin -lsicuuc -lsicudt C:\libQT-5.11-dev\build\qtbase\lib\libqtpcre2.a
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x329): undefined reference to `__imp__ZN14QPatternistSDK8TreeItem12executeRangeE'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x400): undefined reference to `__imp__ZN14QPatternistSDK9TestSuite11openCatalogERK4QUrlR7QStringbNS0_9SuiteTypeE'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x54b): undefined reference to `__imp__ZN14QPatternistSDK9TestSuite8runSuiteEv'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x857): undefined reference to `__imp__ZN14QPatternistSDK9XMLWriterC1EP9QIODevice'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x863): undefined reference to `__imp__ZNK14QPatternistSDK15TestSuiteResult5toXMLERNS_9XMLWriterE'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x871): undefined reference to `__imp__ZN14QPatternistSDK15TestSuiteResultD1Ev'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x896): undefined reference to `__imp__ZN14QPatternistSDK9XMLWriterD1Ev'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0x8ef): undefined reference to `__imp__ZN14QPatternistSDK9XMLWriterD1Ev'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0xac7): undefined reference to `__imp__ZN14QPatternistSDK6WorkerC1ER10QEventLoopRK9QFileInfoS5_'
      .obj/release/tst_suitetest.o:tst_suitetest.cpp:(.text+0xea7): undefined reference to `__imp__ZN14QPatternistSDK14ResultThreaderC1ER10QEventLoopP5QFileNS0_4TypeEP7QObject'
      collect2.exe: error: ld returned 1 exit status
      mingw32-make[5]: *** [Makefile.Release:72: release\tst_xmlpatternsdiagnosticsts.exe] Error 1
      mingw32-make[5]: Leaving directory 'c:/libQT-5.11-dev/build/qtxmlpatterns/tests/auto/xmlpatternsdiagnosticsts'
      mingw32-make[4]: *** [Makefile:36: release] Error 2
      mingw32-make[4]: Leaving directory 'c:/libQT-5.11-dev/build/qtxmlpatterns/tests/auto/xmlpatternsdiagnosticsts'
      mingw32-make[3]: *** [Makefile:649: sub-xmlpatternsdiagnosticsts-make_first] Error 2
      mingw32-make[3]: Leaving directory 'c:/libQT-5.11-dev/build/qtxmlpatterns/tests/auto'
      mingw32-make[2]: *** [Makefile:41: sub-auto-make_first] Error 2
      mingw32-make[2]: Leaving directory 'c:/libQT-5.11-dev/build/qtxmlpatterns/tests'
      mingw32-make[1]: *** [Makefile:119: sub-tests-make_first] Error 2
      mingw32-make[1]: Leaving directory 'c:/libQT-5.11-dev/build/qtxmlpatterns'
      mingw32-make: *** [Makefile:306: module-qtxmlpatterns-make_first] Error 2
      

       

      and MSVC:

              cd xmlpatternsdiagnosticsts\ && ( if not exist Makefile C:\libQT-5.11-dev\build\qtbase\bin\qmake.exe -o Makefile C:\libQT-5.11-dev\build\qtxmlpatterns\tests\auto\xmlpatternsdiagnosticsts\xmlpatternsdiagnosticsts.pro ) && C:\Windows\jom.exe -f Makefile
              C:\Windows\jom.exe -f Makefile.Release
              link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:release\tst_xmlpatternsdiagnosticsts.exe @C:\Users\test\AppData\Local\Temp\tst_xmlpatternsdiagnosticsts.exe.7372.31.jom
         Creating library release\tst_xmlpatternsdiagnosticsts.lib and object release\tst_xmlpatternsdiagnosticsts.exp
      tst_suitetest.obj : warning LNK4217: locally defined symbol ??0XMLWriter@QPatternistSDK@@QEAA@PEAVQIODevice@@@Z (public: __cdecl QPatternistSDK::XMLWriter::XMLWriter(class QIODevice *)) imported in function "private: void __cdecl tst_SuiteTest::runTestSuite(void)const " (?runTestSuite@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : warning LNK4217: locally defined symbol ??1XMLWriter@QPatternistSDK@@UEAA@XZ (public: virtual __cdecl QPatternistSDK::XMLWriter::~XMLWriter(void)) imported in function "private: void __cdecl tst_SuiteTest::runTestSuite(void)const " (?runTestSuite@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : warning LNK4217: locally defined symbol ??0ResultThreader@QPatternistSDK@@QEAA@AEAVQEventLoop@@PEAVQFile@@W4Type@01@PEAVQObject@@@Z (public: __cdecl QPatternistSDK::ResultThreader::ResultThreader(class QEventLoop &,class QFile *,enum QPatternistSDK::ResultThreader::Type,class QObject *)) imported in function "private: void __cdecl tst_SuiteTest::checkTestSuiteResult(void)const " (?checkTestSuiteResult@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : warning LNK4217: locally defined symbol ??1ResultThreader@QPatternistSDK@@UEAA@XZ (public: virtual __cdecl QPatternistSDK::ResultThreader::~ResultThreader(void)) imported in function "public: virtual void * __cdecl QPatternistSDK::ResultThreader::`scalar deleting destructor'(unsigned int)" (??_GResultThreader@QPatternistSDK@@UEAAPEAXI@Z)
      tst_suitetest.obj : warning LNK4217: locally defined symbol ??0Worker@QPatternistSDK@@QEAA@AEAVQEventLoop@@AEBVQFileInfo@@1@Z (public: __cdecl QPatternistSDK::Worker::Worker(class QEventLoop &,class QFileInfo const &,class QFileInfo const &)) imported in function "private: void __cdecl tst_SuiteTest::checkTestSuiteResult(void)const " (?checkTestSuiteResult@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : warning LNK4217: locally defined symbol ??1Worker@QPatternistSDK@@UEAA@XZ (public: virtual __cdecl QPatternistSDK::Worker::~Worker(void)) imported in function "public: virtual void * __cdecl QPatternistSDK::Worker::`scalar deleting destructor'(unsigned int)" (??_GWorker@QPatternistSDK@@UEAAPEAXI@Z)
      tst_suitetest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QPatternistSDK::TestSuite * __cdecl QPatternistSDK::TestSuite::openCatalog(class QUrl const &,class QString &,bool,enum QPatternistSDK::TestSuite::SuiteType)" (__imp_?openCatalog@TestSuite@QPatternistSDK@@SAPEAV12@AEBVQUrl@@AEAVQString@@_NW4SuiteType@12@@Z) referenced in function "private: void __cdecl tst_SuiteTest::runTestSuite(void)const " (?runTestSuite@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QPatternistSDK::TestSuiteResult * __cdecl QPatternistSDK::TestSuite::runSuite(void)" (__imp_?runSuite@TestSuite@QPatternistSDK@@QEAAPEAVTestSuiteResult@2@XZ) referenced in function "private: void __cdecl tst_SuiteTest::runTestSuite(void)const " (?runTestSuite@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QPatternistSDK::TestSuiteResult::~TestSuiteResult(void)" (__imp_??1TestSuiteResult@QPatternistSDK@@QEAA@XZ) referenced in function "private: void __cdecl tst_SuiteTest::runTestSuite(void)const " (?runTestSuite@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QPatternistSDK::TestSuiteResult::toXML(class QPatternistSDK::XMLWriter &)const " (__imp_?toXML@TestSuiteResult@QPatternistSDK@@QEBAXAEAVXMLWriter@2@@Z) referenced in function "private: void __cdecl tst_SuiteTest::runTestSuite(void)const " (?runTestSuite@tst_SuiteTest@@AEBAXXZ)
      tst_suitetest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct QPair<int,int> QPatternistSDK::TreeItem::executeRange" (__imp_?executeRange@TreeItem@QPatternistSDK@@2U?$QPair@HH@@A) referenced in function "private: void __cdecl tst_SuiteTest::runTestSuite(void)const " (?runTestSuite@tst_SuiteTest@@AEBAXXZ)
      release\tst_xmlpatternsdiagnosticsts.exe : fatal error LNK1120: 5 unresolved externals
      jom: C:\libQT-5.11-dev\build\qtxmlpatterns\tests\auto\xmlpatternsdiagnosticsts\Makefile.Release [release\tst_xmlpatternsdiagnosticsts.exe] Error 1120
      jom: C:\libQT-5.11-dev\build\qtxmlpatterns\tests\auto\xmlpatternsdiagnosticsts\Makefile [release] Error 2
      jom: C:\libQT-5.11-dev\build\qtxmlpatterns\tests\auto\Makefile [sub-xmlpatternsdiagnosticsts-make_first] Error 2
      jom: C:\libQT-5.11-dev\build\qtxmlpatterns\tests\Makefile [sub-auto-make_first] Error 2
      jom: C:\libQT-5.11-dev\build\qtxmlpatterns\Makefile [sub-tests-make_first] Error 2
      jom: C:\libQT-5.11-dev\build\Makefile [module-qtxmlpatterns-make_first] Error 2
      

       

      The same for:

      xmlpatternsxqts
      xmlpatternsxslts
      xmlpatternsschemats

      tests build too.

       

      Reproduced for:

      • static builds using mingw-w64 and MSVC with '-developer-build' flag,

      not reproduced for:

      • shared builds using mingw-w64 and MSVC with '-developer-build' flag.

       

       

      Best,

      Alexander

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              iamsergio Sergio Martins
              Reporter:
              sav sav
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes