QT5.11.1 building failed via build tools v142 in Visual Studio 2019
-
In qevent.h or qevent.cpp, no using Q_OBJECT, and why there is a reference to MetaObject? confusing...?
cl -c -FIqt_gui_pch.h -Yuqt_gui_pch.h -Fp.pch\debug\Qt5Guid_pch.pch -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\debug\Qt5Guid.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_CORE_LIB -DQT_CORE_LIB -DQT_NO_EXCEPTIONS -D_WINDLL -IR:\software\qt5\qt5\qtbase\src\gui -I. -IR:\software\qt5\qt5\qtbase\src\3rdparty\zlib\src -I..\..\include -I..\..\include\QtGui -I..\..\include\QtANGLE -I..\..\include\QtGui\5.11.1 -I..\..\include\QtGui\5.11.1\QtGui -Itmp -I.tracegen\debug -I..\..\include\QtCore\5.11.1 -I..\..\include\QtCore\5.11.1\QtCore -I..\..\include\QtCore -I.moc\debug -IR:\software\qt5\qt5\qtbase\src\3rdparty\libpng -IR:\software\qt5\qt5\qtbase\src\3rdparty\harfbuzz-ng\include -IR:\software\qt5\qt5\qtbase\mkspecs\win32-msvc -Fo.obj\debug\ @C:\Users\John\AppData\Local\Temp\nmE8E3.tmp
qevent.cpp
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /SUBSYSTEM:WINDOWS /VERSION:5.11 /MANIFEST:embed /OUT:....\lib\Qt5Guid.dll @C:\Users\John\AppData\Local\Temp\nmF0F3.tmp
Creating library ....\lib\Qt5Guid.lib and object ....\lib\Qt5Guid.exp
qevent.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QTabletEvent::staticMetaObject" (?staticMetaObject@QTabletEvent@@2UQMetaObject@@B)
....\lib\Qt5Guid.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'E:\app\MStudio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.EXE' : return code '0x460'
Stop.
NMAKE : fatal error U1077: 'E:\app\MStudio\2019\Community\VC\Tools\MSVC\14.29.30133\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. -
Why Qt 5.11? It’s been out of support for a while.
E.g Qt 5.15 doesn’t support Windows 11.
I have no idea about 5.11, but probably your windows version and/or compiler isn’t supported.
Better use Qt 6. -
https://forum.qt.io/topic/94122/how-to-resolve-c3615-errors-in-visual-studio-2017/13
Because this guy said "I just delete Qt 5.5 and installed Qt 5.11.1 and downloaded WebKit package.
and added to correct path, building is succeeded!", And I have an app which was building on QT5.5.1 https://github.com/shadowsocks/libQtShadowsocks.git -
That was 6 years ago!
-
after applied this patch https://github.com/qt/qtbase/commit/0ef66e98ccf4946a0e4513ab5fc157df0f0aca4e and deleted qtquick1 submodule, QT5.11.1 built success. Thanks.