Building A static version of Qt 5.2.1 with Visual Studio 2013

后端 未结 2 1959
情深已故
情深已故 2021-02-08 23:02

I have been trying for a few days now to build a static version of Qt with Visual Studio 2013. I just cannot figure out what I did wrong.

System:

  • Windows 7
相关标签:
2条回答
  • 2021-02-08 23:16

    There is a bug in make install when using -angle and -static.

    You can find the bug report here.

    A simple workaround is to add a few copy at the end of the build process:

    copy qtbase\lib\translator_common.lib C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\translator_common.prl C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\translator_commond.lib C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\translator_commond.prl C:\Qt\5.3.0\msvc2013-static\lib\
    
    copy qtbase\lib\translator_hlsl.lib C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\translator_hlsl.prl C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\translator_hlsld.lib C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\translator_hlsld.prl C:\Qt\5.3.0\msvc2013-static\lib\
    
    copy qtbase\lib\preprocessor.lib C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\preprocessor.prl C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\preprocessord.lib C:\Qt\5.3.0\msvc2013-static\lib\
    copy qtbase\lib\preprocessord.prl C:\Qt\5.3.0\msvc2013-static\lib\
    

    I hope this can help others.

    0 讨论(0)
  • 2021-02-08 23:26

    I happened to met with the same issue. I think the lib file you want to link against is translator_commond.lib. It contains the ANGEL symbols.

    Here is how I found out the name of the library, in case it could be helpful when you met with other unresolved external symbols with Qt.

    The dumpbin.exe tool is quite helpful here. You could execute dumpbin.exe /symbols some_lib.lib | findstr /c:"SOME_SYMBOL" to found whether a library contains or uses an symbol.

    Since there are so many libs in Qt, I simply search for all *.lib files in Qt directory and copy them into a single directory, and then I do a batch search using the command below.

    for %f in (*.lib) do echo %f >> symbols.txt && dumpbin /symbols %f | findstr /c:"SOME_SYMBOL" >> symbols.txt
    

    Once done, you could check the generated symbols.txt and find out the name of the library that contains the symbol you are looking for.

    BTW, since there are several huge libs, e.g. Qt5Core, Qt5Quick, etc, you probably would like to exclude them from searching.

    0 讨论(0)
提交回复
热议问题