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

'undefined reference' errors during 'textureprovider' example build on Windows

    XMLWordPrintable

Details

    Description

      Hi, Everyone,

      Got errors for Qt builds using Mingw-w64:

      (configure -prefix "%CD%\..\GCC64d\dll" -debug -opensource -c++std c++11 -shared -plugin-sql-sqlite -opengl dynamic -openvg -platform win32-g++ -iconv -no-pch -qt-zlib -qt-pcre -icu -I "%CD%\..\..\libICU-57.1\GCC64d\include" -L "%CD%\..\..\libICU-57.1\GCC64d\lib" -qt-libpng -qt-libjpeg -avx -openssl -I "%CD%\..\..\libOPENSSL-1.1.0-dev\GCC64d\include" -L "%CD%\..\..\libOPENSSL-1.1.0-dev\GCC64d\lib" -dbus-runtime -confirm-license >_configure.log && mingw32-make -j%NUMBER_OF_PROCESSORS% >_make.log && mingw32-make -j%NUMBER_OF_PROCESSORS% install >_install.log && mingw32-make -j%NUMBER_OF_PROCESSORS% docs >_docs.log && mingw32-make -j%NUMBER_OF_PROCESSORS% install_docs >_install_docs.log) 2>_stderr.log && copy *.log "%CD%\..\GCC64d\dll"
      
      [snip]
      
      mingw32-make[5]: Entering directory 'c:/libQT-5.7-dev/src/qtdeclarative/examples/quick/textureprovider'
      g++ -Wl,-subsystem,windows -o debug\textureprovider.exe .obj/debug/main.o .obj/debug/etcprovider.o .obj/debug/qrc_textureprovider.o .obj/debug/moc_etcprovider.o  -lmingw32 -Lc:\libQT-5.7-dev\src\qtbase\lib c:\libQT-5.7-dev\src\qtbase\lib\libqtmaind.a -Lc:\libICU-57.1\GCC64d\lib -Lc:\libOPENSSL-1.1.0-dev\GCC64d\lib -lshell32 -Lc:\libQT-5.7-dev\src\qtdeclarative\lib c:\libQT-5.7-dev\src\qtdeclarative\lib\libQt5Quickd.a c:\libQT-5.7-dev\src\qtbase\lib\libQt5Guid.a c:\libQT-5.7-dev\src\qtdeclarative\lib\libQt5Qmld.a c:\libQT-5.7-dev\src\qtbase\lib\libQt5Networkd.a c:\libQT-5.7-dev\src\qtbase\lib\libQt5Cored.a
      .obj/debug/etcprovider.o: In function `EtcTexture::~EtcTexture()':
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:107: undefined reference to `__imp_glDeleteTextures'
      .obj/debug/etcprovider.o: In function `EtcTexture::textureId() const':
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:113: undefined reference to `__imp_glGenTextures'
      .obj/debug/etcprovider.o: In function `EtcTexture::bind()':
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:120: undefined reference to `__imp_glBindTexture'
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:125: undefined reference to `__imp_glGenTextures'
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:126: undefined reference to `__imp_glBindTexture'
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:134: undefined reference to `__imp_glGetError'
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:146: undefined reference to `__imp_glGetError'
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:149: undefined reference to `__imp_glBindTexture'
      c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider/etcprovider.cpp:150: undefined reference to `__imp_glDeleteTextures'
      collect2.exe: error: ld returned 1 exit status
      Makefile.Debug:67: recipe for target 'debug\textureprovider.exe' failed
      mingw32-make[5]: *** [debug\textureprovider.exe] Error 1
      mingw32-make[5]: Leaving directory 'c:/libQT-5.7-dev/src/qtdeclarative/examples/quick/textureprovider'
      Makefile:34: recipe for target 'debug' failed
      mingw32-make[4]: *** [debug] Error 2
      mingw32-make[4]: Leaving directory 'c:/libQT-5.7-dev/src/qtdeclarative/examples/quick/textureprovider'
      Makefile:492: recipe for target 'sub-textureprovider-make_first' failed
      mingw32-make[3]: *** [sub-textureprovider-make_first] Error 2
      mingw32-make[3]: Leaving directory 'c:/libQT-5.7-dev/src/qtdeclarative/examples/quick'
      Makefile:90: recipe for target 'sub-quick-make_first' failed
      mingw32-make[2]: *** [sub-quick-make_first] Error 2
      mingw32-make[2]: Leaving directory 'c:/libQT-5.7-dev/src/qtdeclarative/examples'
      Makefile:92: 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.7-dev/src/qtdeclarative'
      Makefile:326: recipe for target 'module-qtdeclarative-make_first' failed
      mingw32-make: *** [module-qtdeclarative-make_first] Error 2
      

      and MSVC:

      configure -prefix "%CD%\..\MSVC64r\dll" -release -opensource -c++std c++11 -shared -plugin-sql-sqlite -opengl dynamic -openvg -platform win32-msvc2015 -iconv -no-pch -qt-zlib -qt-pcre -icu -I "%CD%\..\..\libICU-57.1\MSVC64r\include" -L "%CD%\..\..\libICU-57.1\MSVC64r\lib" -qt-libpng -qt-libjpeg -avx -openssl -I "%CD%\..\..\libOPENSSL-1.1.0-dev\MSVC64r\dll\include" -L "%CD%\..\..\libOPENSSL-1.1.0-dev\MSVC64r\dll\lib" -dbus-runtime -confirm-license && jom
      
      [snip]
      
              cd textureprovider\ && ( if not exist Makefile c:\libQT-5.7-dev\src\qtbase\bin\qmake c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider\textureprovider.pro -o Makefile ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\jom.exe" -f Makefile
              "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\jom.exe" -f Makefile.Release
              link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:release\textureprovider.exe @C:\Users\user\AppData\Local\Temp\textureprovider.exe.3824.0.jom
      etcprovider.obj : error LNK2019: unresolved external symbol __imp_glBindTexture referenced in function "public: virtual void __cdecl EtcTexture::bind(void)" (?bind@EtcTexture@@UEAAXXZ)
      jom: c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider\Makefile.Release [release\textureprovider.exe] Error 1120
      etcprovider.obj : error LNK2019: unresolved external symbol __imp_glDeleteTextures referenced in function "public: virtual __cdecl EtcTexture::~EtcTexture(void)" (??1EtcTexture@@UEAA@XZ)
      etcprovider.obj : error LNK2019: unresolved external symbol __imp_glGenTextures referenced in function "public: virtual void __cdecl EtcTexture::bind(void)" (?bind@EtcTexture@@UEAAXXZ)
      release\textureprovider.exe : fatal error LNK1120: 3 unresolved externals
      jom: c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\textureprovider\Makefile [release] Error 2
      jom: c:\libQT-5.7-dev\src\qtdeclarative\examples\quick\Makefile [sub-textureprovider-make_first] Error 2
      jom: c:\libQT-5.7-dev\src\qtdeclarative\examples\Makefile [sub-quick-make_first] Error 2
      jom: c:\libQT-5.7-dev\src\qtdeclarative\Makefile [sub-examples-make_first] Error 2
      

      It appeared after moving to recent Qt-5.7.0-dev branch (2016-06-03), and didn't reproduce with Qt-5.7-dev branch (2016-05-11).

      It inherent to shared builds with -opengl dynamic key, while not reproduced for static builds with -opengl desktop key.

      Since it breaks Qt builds using Mingw-w64 and MSVC, it possible to fix it?

      Regards,
      Alexander

      Attachments

        Issue Links

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

          Activity

            People

              kkohne Kai Köhne
              sav sav
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes