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

'multiple definition' and 'already defined' errors for QtDeclarative.Textureprovider example builds on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.10
    • Fix Version/s: 5.10.0 Alpha
    • Labels:
      None
    • Environment:
       * Windows 10 x64,
       * mingw-w64 x86_64 6.3.0,
       * MSVC 2015 Update 3,
       * Windows SDK 10.0.14393.33.

      Description

      Hello, everyone,

       

      Got errors for builds using mingw-w64:

      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/textureprovider'
      g++ -Wl,-s -static -Wl,-subsystem,windows -o release\textureprovider.exe .obj/release/main.o .obj/release/etcprovider.o .obj/release/textureprovider_plugin_import.o .obj/release/textureprovider_qml_plugin_import.o .obj/release/qrc_textureprovider.o .obj/release/moc_etcprovider.o  -lmingw32 -LC:\libQT-5.10-dev\build\qtbase\lib C:\libQT-5.10-dev\build\qtbase\lib\libqtmain.a -LC:\libICU-59.1\GCC64RT\lib -LC:\libQT-5.10-dev\build\qtbase\plugins\platforms C:\libQT-5.10-dev\build\qtbase\plugins\platforms\libqwindows.a -ldwmapi -lwinspool -lshlwapi -lrpcrt4 C:\libQT-5.10-dev\build\qtbase\lib\libQt5EventDispatcherSupport.a C:\libQT-5.10-dev\build\qtbase\lib\libQt5AccessibilitySupport.a C:\libQT-5.10-dev\build\qtbase\lib\libQt5FontDatabaseSupport.a C:\libQT-5.10-dev\build\qtbase\lib\libqtfreetype.a C:\libQT-5.10-dev\build\qtbase\lib\libQt5ThemeSupport.a -LC:\libQT-5.10-dev\build\qtimageformats\plugins\imageformats C:\libQT-5.10-dev\build\qtimageformats\plugins\imageformats\libqicns.a C:\libQT-5.10-dev\build\qtimageformats\plugins\imageformats\libqtga.a C:\libQT-5.10-dev\build\qtimageformats\plugins\imageformats\libqtiff.a C:\libQT-5.10-dev\build\qtimageformats\plugins\imageformats\libqwbmp.a C:\libQT-5.10-dev\build\qtimageformats\plugins\imageformats\libqwebp.a -LC:\libQT-5.10-dev\build\qtbase\plugins\imageformats C:\libQT-5.10-dev\build\qtbase\plugins\imageformats\libqgif.a C:\libQT-5.10-dev\build\qtbase\plugins\imageformats\libqico.a C:\libQT-5.10-dev\build\qtbase\plugins\imageformats\libqjpeg.a -LC:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_debugger.a -LC:\libQT-5.10-dev\build\qtdeclarative\lib C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_inspector.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_local.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_messages.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_native.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_nativedebugger.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_profiler.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_quickprofiler.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_server.a C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5PacketProtocol.a C:\libQT-5.10-dev\build\qtdeclarative\plugins\qmltooling\libqmldbg_tcp.a -LC:\libQT-5.10-dev\build\qtbase\plugins\bearer C:\libQT-5.10-dev\build\qtbase\plugins\bearer\libqgenericbearer.a C:\libQT-5.10-dev\build\qtbase\plugins\bearer\libqnativewifibearer.a -LC:\libQT-5.10-dev\build\qtdeclarative\qml\QtQuick.2 C:\libQT-5.10-dev\build\qtdeclarative\qml\QtQuick.2\libqtquick2plugin.a C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a C:\libQT-5.10-dev\build\qtbase\lib\libQt5Gui.a -lgdi32 -lcomdlg32 -loleaut32 -limm32 C:\libQT-5.10-dev\build\qtbase\lib\libqtlibpng.a C:\libQT-5.10-dev\build\qtbase\lib\libqtharfbuzz.a C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Qml.a C:\libQT-5.10-dev\build\qtbase\lib\libQt5Network.a -ldnsapi -liphlpapi C:\libQT-5.10-dev\build\qtbase\lib\libQt5Core.a -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lnetapi32 -luserenv -lversion -lwinmm -lz -lsicuin -lsicuuc C:\libICU-59.1\GCC64RT\lib\sicudt.a C:\libQT-5.10-dev\build\qtbase\lib\libqtpcre2.a
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0x0): multiple definition of `EtcTexture::EtcTexture()'
      .obj/release/etcprovider.o:etcprovider.cpp:(.text+0x40): first defined here
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0x0): multiple definition of `EtcTexture::EtcTexture()'
      .obj/release/etcprovider.o:etcprovider.cpp:(.text+0x40): first defined here
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0x70): multiple definition of `EtcTexture::~EtcTexture()'
      .obj/release/etcprovider.o:etcprovider.cpp:(.text+0xb0): first defined here
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0x70): multiple definition of `EtcTexture::~EtcTexture()'
      .obj/release/etcprovider.o:etcprovider.cpp:(.text+0xb0): first defined here
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0xe0): multiple definition of `EtcTexture::~EtcTexture()'
      .obj/release/etcprovider.o:etcprovider.cpp:(.text+0x120): first defined here
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0x100): multiple definition of `EtcTexture::textureId() const'
      .obj/release/etcprovider.o:etcprovider.cpp:(.text+0x140): first defined here
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0x130): multiple definition of `EtcTexture::hasAlphaChannel() const'
      .obj/release/moc_etcprovider.o:moc_etcprovider.cpp:(.text$_ZNK10EtcTexture15hasAlphaChannelEv[_ZNK10EtcTexture15hasAlphaChannelEv]+0x0): first defined here
      C:\libQT-5.10-dev\build\qtdeclarative\lib\libQt5Quick.a(qsgpkmhandler.o):qsgpkmhandler.cpp:(.text+0x140): multiple definition of `EtcTexture::bind()'
      .obj/release/etcprovider.o:etcprovider.cpp:(.text+0x170): first defined here
      collect2.exe: error: ld returned 1 exit status
      Makefile.Release:73: recipe for target 'release\textureprovider.exe' failed
      mingw32-make[3]: *** [release\textureprovider.exe] Error 1
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/textureprovider'
      Makefile:36: recipe for target 'release' failed
      mingw32-make[2]: *** [release] Error 2
      mingw32-make[2]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/textureprovider'
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/particles/system'
      mingw32-make[4]: Nothing to be done for 'first'.
      Makefile:745: recipe for target 'sub-textureprovider-make_first' failed
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/particles/system'
      mingw32-make[1]: *** [sub-textureprovider-make_first] Error 2
      mingw32-make[1]: *** Waiting for unfinished jobs....
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/particles/system'
      mingw32-make[2]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/particles'
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/tweetsearch'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/tweetsearch'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/tweetsearch'
      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/maroon'
      mingw32-make -f Makefile.Release
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/maroon'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/maroon'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/maroon'
      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/quickwidget'
      mingw32-make -f Makefile.Release
      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photosurface'
      mingw32-make -f Makefile.Release
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photosurface'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photosurface'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photosurface'
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/quickwidget'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/quickwidget'
      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/qquickviewcomparison'
      mingw32-make -f Makefile.Release
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/quickwidget'
      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/stocqt'
      mingw32-make -f Makefile.Release
      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photoviewer'
      mingw32-make -f Makefile.Release
      mingw32-make[3]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/rssnews'
      mingw32-make -f Makefile.Release
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/qquickviewcomparison'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/qquickviewcomparison'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets/qquickviewcomparison'
      mingw32-make[2]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/quickwidgets'
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photoviewer'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photoviewer'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/photoviewer'
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/stocqt'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/stocqt'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/stocqt'
      mingw32-make[4]: Entering directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/rssnews'
      mingw32-make[4]: Nothing to be done for 'first'.
      mingw32-make[4]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/rssnews'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos/rssnews'
      mingw32-make[2]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick/demos'
      mingw32-make[1]: Leaving directory 'c:/libQT-5.10-dev/build/qtdeclarative/examples/quick'
      Makefile:92: recipe for target 'sub-quick-make_first' failed
      mingw32-make: *** [sub-quick-make_first] Error 2

       

      and MSVC:

              cd textureprovider\ && ( if not exist Makefile C:\libQT-5.10-dev\build\qtbase\bin\qmake.exe -o Makefile C:\libQT-5.10-dev\build\qtdeclarative\examples\quick\textureprovider\textureprovider.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.
      
              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\test\AppData\Local\Temp\nm4CB3.tmp
      Qt5Quick.lib(qsgpkmhandler.obj) : error LNK2005: "public: __cdecl EtcTexture::EtcTexture(void)" (??0EtcTexture@@QEAA@XZ) already defined in etcprovider.obj
      Qt5Quick.lib(qsgpkmhandler.obj) : error LNK2005: "public: virtual __cdecl EtcTexture::~EtcTexture(void)" (??1EtcTexture@@UEAA@XZ) already defined in etcprovider.obj
      Qt5Quick.lib(qsgpkmhandler.obj) : error LNK2005: "public: virtual void __cdecl EtcTexture::bind(void)" (?bind@EtcTexture@@UEAAXXZ) already defined in etcprovider.obj
      Qt5Quick.lib(qsgpkmhandler.obj) : error LNK2005: "public: virtual bool __cdecl EtcTexture::hasAlphaChannel(void)const " (?hasAlphaChannel@EtcTexture@@UEBA_NXZ) already defined in etcprovider.obj
      Qt5Quick.lib(qsgpkmhandler.obj) : error LNK2005: "public: virtual int __cdecl EtcTexture::textureId(void)const " (?textureId@EtcTexture@@UEBAHXZ) already defined in etcprovider.obj
         Creating library release\textureprovider.lib and object release\textureprovider.exp
      release\textureprovider.exe : fatal error LNK1169: one or more multiply defined symbols found
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.EXE"' : return code '0x491'
      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.

       

      Reproduced for:

      • builds with Static configuration,

      not reproduced for:

      • builds with Shared configuration,
      • builds using Qt-5.9.

       

      Alexander

       

        Attachments

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

          Activity

            People

            Assignee:
            shausman Simon Hausmann
            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