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

'undefined reference' and 'unresolved external symbol' errors for QtSpeech 'hello_speak' example builds using mingw-w64 and ICC on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.4
    • 5.9, 5.10
    • Speech
    • None
    • * Windows 10 x64,
       * mingw-w64 x86_64 6.3.0,
       * IPSXE 2017 Update 4,
       * MSVC 2015 Update 3,
       * Windows SDK 10.0.14393.33.
    • 16ab9c262b1d53222913da96f7a14485e3ef0836

    Description

      Hello everyone,

      Got errors for builds using mingw-w64:

      mingw32-make[4]: Entering directory 'c:/libQT-5.9.1/build/qtspeech/examples/speech/hello_speak'
      mingw32-make -f Makefile.Release
      mingw32-make[5]: Entering directory 'c:/libQT-5.9.1/build/qtspeech/examples/speech/hello_speak'
      g++ -Wl,-s -static -Wl,-subsystem,windows -o release\hello_speak.exe .obj/release/main.o .obj/release/mainwindow.o .obj/release/hello_speak_plugin_import.o .obj/release/moc_mainwindow.o  -lmingw32 -Lc:\libQT-5.9.1\build\qtbase\lib c:\libQT-5.9.1\build\qtbase\lib\libqtmain.a -Lc:\libICU-59.1\GCC64RT\lib -Lc:\libQT-5.9.1\build\qtbase\plugins\platforms c:\libQT-5.9.1\build\qtbase\plugins\platforms\libqwindows.a -lwinspool -lshlwapi c:\libQT-5.9.1\build\qtbase\lib\libQt5EventDispatcherSupport.a c:\libQT-5.9.1\build\qtbase\lib\libQt5AccessibilitySupport.a c:\libQT-5.9.1\build\qtbase\lib\libQt5FontDatabaseSupport.a c:\libQT-5.9.1\build\qtbase\lib\libqtfreetype.a c:\libQT-5.9.1\build\qtbase\lib\libQt5ThemeSupport.a -Lc:\libQT-5.9.1\build\qtimageformats\plugins\imageformats c:\libQT-5.9.1\build\qtimageformats\plugins\imageformats\libqicns.a c:\libQT-5.9.1\build\qtimageformats\plugins\imageformats\libqtga.a c:\libQT-5.9.1\build\qtimageformats\plugins\imageformats\libqtiff.a c:\libQT-5.9.1\build\qtimageformats\plugins\imageformats\libqwbmp.a c:\libQT-5.9.1\build\qtimageformats\plugins\imageformats\libqwebp.a -Lc:\libQT-5.9.1\build\qtbase\plugins\imageformats c:\libQT-5.9.1\build\qtbase\plugins\imageformats\libqgif.a c:\libQT-5.9.1\build\qtbase\plugins\imageformats\libqico.a c:\libQT-5.9.1\build\qtbase\plugins\imageformats\libqjpeg.a -Lc:\libQT-5.9.1\build\qtspeech\plugins\texttospeech c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a -lsapi -Lc:\libQT-5.9.1\build\qtspeech\lib c:\libQT-5.9.1\build\qtbase\lib\libQt5Widgets.a -luxtheme -ldwmapi c:\libQT-5.9.1\build\qtbase\lib\libQt5Gui.a -lgdi32 -lcomdlg32 -loleaut32 -limm32 c:\libQT-5.9.1\build\qtbase\lib\libqtlibpng.a c:\libQT-5.9.1\build\qtbase\lib\libqtharfbuzz.a c:\libQT-5.9.1\build\qtspeech\lib\libQt5TextToSpeech.a c:\libQT-5.9.1\build\qtbase\lib\libQt5Core.a -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lsicuin -lsicuuc c:\libICU-59.1\GCC64RT\lib\sicudt.a -lversion -lwinmm -lz c:\libQT-5.9.1\build\qtbase\lib\libqtpcre2.a
      .obj/release/main.o:main.cpp:(.text+0xda): undefined reference to `__imp__ZN6QVoiceD1Ev'
      .obj/release/mainwindow.o:mainwindow.cpp:(.text+0x1a): undefined reference to `__imp__ZN13QTextToSpeech7setRateEd'
      .obj/release/mainwindow.o:mainwindow.cpp:(.text+0x3a): undefined reference to `__imp__ZN13QTextToSpeech8setPitchEd'
      .obj/release/mainwindow.o:mainwindow.cpp:(.text+0x5a): undefined reference to `__imp__ZN13QTextToSpeech9setVolumeEd'
      .obj/release/mainwindow.o:mainwindow.cpp:(.text+0xab): undefined reference to `__imp__ZN13QTextToSpeech9setLocaleERK7QLocale'
      .obj/release/mainwindow.o:mainwindow.cpp:(.text+0xdc): undefined reference to `__imp__ZN13QTextToSpeech8setVoiceERK6QVoice'
      
      <snip>
      
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(qtexttospeech_sapi.o):qtexttospeech_sapi.cpp:(.text$_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE[_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE]+0xc7): more undefined references to `__imp__ZN6QVoiceC1ERKS_' follow
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(qtexttospeech_sapi.o):qtexttospeech_sapi.cpp:(.text$_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE[_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE]+0x132): undefined reference to `__imp__ZN6QVoiceD1Ev'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(qtexttospeech_sapi.o):qtexttospeech_sapi.cpp:(.text$_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE[_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE]+0x1a4): undefined reference to `__imp__ZN6QVoiceC1Ev'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(qtexttospeech_sapi.o):qtexttospeech_sapi.cpp:(.text$_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE[_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE]+0x1ef): undefined reference to `__imp__ZN6QVoiceC1Ev'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(qtexttospeech_sapi.o):qtexttospeech_sapi.cpp:(.text$_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE[_ZN7QVectorI6QVoiceE11reallocDataEii6QFlagsIN10QArrayData16AllocationOptionEE]+0x240): undefined reference to `__imp__ZN6QVoiceD1Ev'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(qtexttospeech_sapi.o):qtexttospeech_sapi.cpp:(.text$_ZNK5QListI6QVoiceE8toVectorEv[_ZNK5QListI6QVoiceE8toVectorEv]+0x3e): undefined reference to `__imp__ZN6QVoiceC1Ev'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(qtexttospeech_sapi.o):qtexttospeech_sapi.cpp:(.text$_ZNK5QListI6QVoiceE8toVectorEv[_ZNK5QListI6QVoiceE8toVectorEv]+0x90): undefined reference to `__imp__ZN6QVoiceaSERKS_'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(moc_qtexttospeech_sapi.o):moc_qtexttospeech_sapi.cpp:(.text+0x91): undefined reference to `__imp__ZN19QTextToSpeechEngine11qt_metacastEPKc'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(moc_qtexttospeech_sapi.o):moc_qtexttospeech_sapi.cpp:(.text+0xb3): undefined reference to `__imp__ZN19QTextToSpeechEngine11qt_metacallEN11QMetaObject4CallEiPPv'
      c:\libQT-5.9.1\build\qtspeech\plugins\texttospeech\libqtexttospeech_sapi.a(moc_qtexttospeech_sapi.o):moc_qtexttospeech_sapi.cpp:(.text.startup+0x3): undefined reference to `__imp__ZN19QTextToSpeechEngine16staticMetaObjectE'
      collect2.exe: error: ld returned 1 exit status
      Makefile.Release:69: recipe for target 'release\hello_speak.exe' failed
      mingw32-make[5]: *** [release\hello_speak.exe] Error 1
      mingw32-make[5]: Leaving directory 'c:/libQT-5.9.1/build/qtspeech/examples/speech/hello_speak'
      Makefile:36: recipe for target 'release' failed
      mingw32-make[4]: *** [release] Error 2
      mingw32-make[4]: Leaving directory 'c:/libQT-5.9.1/build/qtspeech/examples/speech/hello_speak'
      Makefile:40: recipe for target 'sub-hello_speak-make_first' failed
      mingw32-make[3]: *** [sub-hello_speak-make_first] Error 2
      mingw32-make[3]: Leaving directory 'c:/libQT-5.9.1/build/qtspeech/examples/speech'
      Makefile:40: recipe for target 'sub-speech-make_first' failed
      mingw32-make[2]: *** [sub-speech-make_first] Error 2
      mingw32-make[2]: Leaving directory 'c:/libQT-5.9.1/build/qtspeech/examples'
      Makefile:67: recipe for target 'sub-examples-make_first' failed
      mingw32-make[1]: *** [sub-examples-make_first] Error 2
      mingw32-make[1]: Leaving directory 'c:/libQT-5.9.1/build/qtspeech'
      Makefile:646: recipe for target 'module-qtspeech-make_first' failed
      mingw32-make: *** [module-qtspeech-make_first] Error 2

      and ICC:

              cd hello_speak\ && ( if not exist Makefile c:\libQT-5.9.1\build\qtbase\bin\qmake.exe -o Makefile c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\hello_speak.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" -f Makefile
      
      Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
              "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" -f Makefile.Release
      
      Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
              echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "release\\hello_speak.exe.embed.manifest">release\hello_speak.exe_manifest.rc
              if not exist release\hello_speak.exe if exist release\hello_speak.exe.embed.manifest del release\hello_speak.exe.embed.manifest
              if exist release\hello_speak.exe.embed.manifest copy /Y release\hello_speak.exe.embed.manifest release\hello_speak.exe_manifest.bak
              xilink /NOLOGO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:release\hello_speak.exe.embed.manifest /OUT:release\hello_speak.exe @C:\Users\test\AppData\Local\Temp\nmCD56.tmp
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\main.obj: locally defined symbol __imp_??1QVoice@@QEAA@XZ imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?availableEngines@QTextToSpeech@@SA?AVQStringList@@XZ imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?localeChanged@QTextToSpeech@@QEAAXAEBVQLocale@@@Z imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?staticMetaObject@QTextToSpeech@@2UQMetaObject@@B imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?stateChanged@QTextToSpeech@@QEAAXW4State@1@@Z imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?resume@QTextToSpeech@@QEAAXXZ imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?pause@QTextToSpeech@@QEAAXXZ imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?stop@QTextToSpeech@@QEAAXXZ imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?setVolume@QTextToSpeech@@QEAAXN@Z imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?setPitch@QTextToSpeech@@QEAAXN@Z imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?setRate@QTextToSpeech@@QEAAXN@Z imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech\hello_speak\.obj\release\mainwindow.obj: locally defined symbol __imp_?locale@QTextToSpeech@@QEBA?AVQLocale@@XZ imported
      ipo: warning #11082: c:\libQT-5.9.1\build\qtspeech\examples\speech
      
      <snip>
      
      qtexttospeech_sapi.lib(qtexttospeech_sapi.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QTextToSpeechEngine::QTextToSpeechEngine(class QObject *)" (__imp_??0QTextToSpeechEngine@@QEAA@PEAVQObject@@@Z) referenced in function "public: __cdecl QTextToSpeechEngineSapi::QTextToSpeechEngineSapi(class QMap<class QString,class QVariant> const &,class QObject *)" (??0QTextToSpeechEngineSapi@@QEAA@AEBV?$QMap@VQString@@VQVariant@@@@PEAVQObject@@@Z)
      qtexttospeech_sapi.lib(qtexttospeech_sapi.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: static class QVariant __cdecl QTextToSpeechEngine::voiceData(class QVoice const &)" (__imp_?voiceData@QTextToSpeechEngine@@KA?AVQVariant@@AEBVQVoice@@@Z) referenced in function "public: virtual class QVoice __cdecl QTextToSpeechEngineSapi::voice(void)const " (?voice@QTextToSpeechEngineSapi@@UEBA?AVQVoice@@XZ)
      qtexttospeech_sapi.lib(qtexttospeech_sapi.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: static class QVoice __cdecl QTextToSpeechEngine::createVoice(class QString const &,enum QVoice::Gender,enum QVoice::Age,class QVariant const &)" (__imp_?createVoice@QTextToSpeechEngine@@KA?AVQVoice@@AEBVQString@@W4Gender@2@W4Age@2@AEBVQVariant@@@Z) referenced in function "private: void __cdecl QTextToSpeechEngineSapi::updateVoices(void)" (?updateVoices@QTextToSpeechEngineSapi@@AEAAXXZ)
      release\hello_speak.exe : fatal error LNK1120: 4 unresolved externals
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\intel64\xilink.EXE"' : return code '0x460'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      ERR

      which appeared after Change #138328 was merged.

       

      Reproduced for:

      • builds using <mingw-w64|ICC> with Static layout,

      not reproduced for:

      • builds using <mingw-w64|ICC> with Shared layout,
      • builds using MSVC with Static layout.

       

       

      Best,

      Alexander

       

      Attachments

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

        Activity

          People

            iamsergio Sergio Martins
            sav sav
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes