Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

static build of Qt 5.14.0 failed with VC2019+Win10



  • hello,

    I just download Qt and source code with online installer, and follow the guide from https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows to build a static Qt.
    VS2019 16.4.2, Win10 x64.

    Open "x86 Native Tools Command Prompt for VS 2019", and type:

    C:\Qt\5.14.0\Src>configure -static -release -platform win32-msvc
    C:\Qt\5.14.0\Src>nmake

    Note: "nmake qtbase" is ok, but "nmake"(with no parameters) will fail with the following error:

    cd animation\ && ( if not exist Makefile C:\Qt\5.14.0\Src\qtbase\bin\qmake.exe -o Makefile C:\Qt\5.14.0\Src\qtdeclarative\examples\quick\animation\animation.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\nmake.exe" -f Makefile

    Microsoft (R) Program Maintenance Utility Version 14.24.28314.0
    Copyright (C) Microsoft Corporation. All rights reserved.

        "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\nmake.exe" -f Makefile.Release
    

    Microsoft (R) Program Maintenance Utility Version 14.24.28314.0
    Copyright (C) Microsoft Corporation. All rights reserved.

        link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /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\animation.exe @C:\Users\happy\AppData\Local\Temp\nm5804.tmp
    

    Qt5Quick.lib(qsgdefaultspritenode.obj) : error LNK2005: "public: __thiscall SpriteMaterialRhiShader::SpriteMaterialRhiShader(void)" (??0SpriteMaterialRhiShader@@QAE@XZ) already defined in Qt5QuickParticles.lib(qquickimageparticle.obj)
    Qt5Quick.lib(qsgdefaultspritenode.obj) : error LNK2005: "public: virtual void __thiscall SpriteMaterialRhiShader::updateSampledImage(class QSGMaterialRhiShader::RenderState &,int,class QSGTexture * *,class QSGMaterial *,class QSGMaterial *)" (?updateSampledImage@SpriteMaterialRhiShader@@UAEXAAVRenderState@QSGMaterialRhiShader@@HPAPAVQSGTexture@@PAVQSGMaterial@@2@Z) already defined in Qt5QuickParticles.lib(qquickimageparticle.obj)
    Qt5Quick.lib(qsgdefaultspritenode.obj) : error LNK2005: "public: virtual bool __thiscall SpriteMaterialRhiShader::updateUniformData(class QSGMaterialRhiShader::RenderState &,class QSGMaterial *,class QSGMaterial *)" (?updateUniformData@SpriteMaterialRhiShader@@UAE_NAAVRenderState@QSGMaterialRhiShader@@PAVQSGMaterial@@1@Z) already defined in Qt5QuickParticles.lib(qquickimageparticle.obj)
    Creating library release\animation.lib and object release\animation.exp
    release\animation.exe : fatal error LNK1169: one or more multiply defined symbols found
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\link.EXE"' : return code '0x491'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\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.


Log in to reply