- 
    
Bug
 - 
    Resolution: Done
 - 
    
P1: Critical
 - 
    None
 - 
    2.8.1 (rev.06)
 - 
    Visual Studio 2019 v16.11.11
 
- 
        8c816ca7cb (qt-labs/vstools/dev)
 
Steps to reproduce
- Build a static version of Qt 6.2.4 (configure.bat -platform win32-msvc -release -nomake examples -nomake tests -opengl desktop -static -static-runtime)
 - In Visual Studio, create a new Hello World project: "File" > "New" > "Project..." (Ctrl + Shift + N) > "Qt Quick Application"
 - Right-click the application in the Solution Explorer and select "Properties" (Alt + Enter)
 - Go to "Configuration Properties" > "C/C++" > "Code Generation" and set "Runtime Library"="Multi-threaded (/MT)"
 - Build the project
 
The project build will fail:
1> Creating library D:\Projects\QtQuickApplication1\x64\Release\QtQuickApplication1.lib and object D:\Projects\QtQuickApplication1\x64\Release\QtQuickApplication1.exp 1>workerscriptplugin.lib(workerscriptplugin_QtQmlWorkerScriptPlugin.cpp.obj) : error LNK2019: unresolved external symbol "void __cdecl qml_register_types_QtQml_WorkerScript(void)" (?qml_register_types_QtQml_WorkerScript@@YAXXZ) referenced in function "private: static __cdecl <lambda_9ebd89eb0fe6b652d7b760a364b8cb4e>::<lambda_invoker_cdecl>(class QtPrivate::QMetaTypeInterface const *,void *)" (?<lambda_invoker_cdecl>@<lambda_9ebd89eb0fe6b652d7b760a364b8cb4e>@@CA@PEBVQMetaTypeInterface@QtPrivate@@PEAX@Z) 1>D:\Projects\QtQuickApplication1\x64\Release\QtQuickApplication1.exe : fatal error LNK1120: 1 unresolved externals
Notes
- The build will succeed if the same static Qt libraries are used to build the same code in Qt Creator
 - The build will succeed if dynamic Qt libraries are used to build the same code in Visual Studio
 
- relates to
 - 
                    
QTVSADDINBUG-919 Qml / quick plugins not handled with static Qt builds
-         
 - Closed
 
 -         
 
- resulted in
 - 
                    
QTVSADDINBUG-1027 RuntimeLibrary metadata of ClCompile not flowing from qmake
-         
     - Closed
 
 -         
 
| For Gerrit Dashboard: QTVSADDINBUG-999 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 422975,3 | Add QML to qmake-generated .vcxproj | dev | qt-labs/vstools | Status: MERGED | +2 | 0 |