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 64 bit
- Visual Studio 2013 (Visual Studio 2012 is still installed)
- Perl is installed (ActivePerl-5.18.2.1801-MSWin32-x64-297964.msi)
- Python is installed (python-2.7.6.amd64.msi)
- Direct X 10 SDK is installed (DXSDK_Jun10.exe I had to use this workaround)
- Downloaded Qt 5.2.1
- Downloaded Qt 5.3.0 alpha
What I did multiple time:
- Extract the sources in a temp folder (C:\QtSrc)
- Delete qtwebkit and qtwebkit-examples directories
For each folder I launched a Visual Studio x86 command line and ran:
- cd C:\QtSrc
- configure -c++11 -mp -debug-and-release -static -angle -nomake tests -nomake examples -prefix C:\Qt\5.2.1\msvc2013 -platform win32-msvc2013
- nmake
- nmake install
This was always sucessfull for every variations of -static vs -shared or Qt 5.2.1 vs Qt 5.3.0 alpha that I tried.
In Qt Creator
I can register the various Kits, compile and launch any example using the shared Qt library. The examples using the static Qt library on the other hand never compiled. The error always looks like this: LNK1104: cannot open file 'C:/Qt/5.3.0/msvc2013-static/lib/translator_common.lib'. The problem is that the file is missing (either translator_commond.lib in debug mode or translator_common.lib in release mode)
In Visual Studio 2013 (with Visual Studio Addin 1.2.3 alpha)
I can add the Qt version and change the Qt version of my solution. If can compile and run a very simple program like this one using the shared version of Qt:
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
int main(int argc,char*argv[]){
QApplication app(argc,argv);
QMessageBox::critical(nullptr,"Hello","Hello Qt!");
return 0;}
I get unresolved external linker errors when using the static version of Qt:
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShInitialize referenced in function "private: void __thiscall gl::Shader::initializeCompiler(void)" (?initializeCompiler@Shader@gl@@AAEXXZ)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShFinalize referenced in function "public: static void __cdecl gl::Shader::releaseCompiler(void)" (?releaseCompiler@Shader@gl@@SAXXZ)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShInitBuiltInResources referenced in function "private: void __thiscall gl::Shader::initializeCompiler(void)" (?initializeCompiler@Shader@gl@@AAEXXZ)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShConstructCompiler referenced in function "private: void __thiscall gl::Shader::initializeCompiler(void)" (?initializeCompiler@Shader@gl@@AAEXXZ)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShDestruct referenced in function "public: static void __cdecl gl::Shader::releaseCompiler(void)" (?releaseCompiler@Shader@gl@@SAXXZ)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShCompile referenced in function "protected: void __thiscall gl::Shader::compileToHLSL(void *)" (?compileToHLSL@Shader@gl@@IAEXPAX@Z)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShGetInfo referenced in function "protected: void __thiscall gl::Shader::compileToHLSL(void *)" (?compileToHLSL@Shader@gl@@IAEXPAX@Z)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShGetInfoLog referenced in function "protected: void __thiscall gl::Shader::compileToHLSL(void *)" (?compileToHLSL@Shader@gl@@IAEXPAX@Z)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShGetObjectCode referenced in function "protected: void __thiscall gl::Shader::compileToHLSL(void *)" (?compileToHLSL@Shader@gl@@IAEXPAX@Z)
1>libGLESv2d.lib(Shader.obj) : error LNK2019: unresolved external symbol _ShGetInfoPointer referenced in function "protected: void __thiscall gl::Shader::compileToHLSL(void *)" (?compileToHLSL@Shader@gl@@IAEXPAX@Z)
Despite all my efforts I was unable to find which lib to include to resolve those missing symbols.
Do you have any idea what I have done wrong ?