Compiler error C3861: 'qTerminate': identifier not found while building QT 6.1.0 for Windows
-
I tried to build QT for Windows with the following steps:
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 set "CMAKE_ROOT=E:\PFiles\cmake-3.19.1-win64-x64\bin" set "NINJA_ROOT=E:\PFiles\ninja-win" set "PERL_ROOT=E:\PFiles\Strawberry\perl\bin" set PATH=%CMAKE_ROOT%;%PATH% set PATH=%NINJA_ROOT%;%PATH% set PATH=%PERL_ROOT%;%PATH% set PATH=E:\PFiles\Python35;%PATH% rem Check if the tools are in PATH where perl.exe where python.exe where cmake.exe where ninja.exe set "MY_INSTALL_PATH=E:\Qt\Qt6.0.2\windows" set CL=/MP configure.bat -prefix %MY_INSTALL_PATH% -DQT_NO_EXCEPTIONS=1 -release -force-debug-info -platform win32-msvc -opengl es2 ^ -opensource -confirm-license -nomake tests -nomake examples ^ -skip qtgraphicaleffects cmake --build . --parallel
but got the following compiler error:
[1052/1801] Building CXX object src\testlib\CMakeFiles\Test.dir\qtestresult.cpp.obj FAILED: src/testlib/CMakeFiles/Test.dir/qtestresult.cpp.obj C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\cl.exe /nologo /TP -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_TESTLIB_LIB -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_MOC_COMPAT -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DATASTREAM -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS=1 -DQT_NO_FOREACH -DQT_USE_QSTRINGBUILDER -DTest_EXPORTS -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_USE_MATH_DEFINES -D_WIN64 -D_WINDLL -Isrc\testlib\Test_autogen\include -Iinclude -Iinclude\QtTest -Isrc\testlib -Iinclude\QtTest\6.1.0 -Iinclude\QtTest\6.1.0\QtTest -Iinclude\QtCore -Imkspecs\win32-msvc -Isrc\corelib -Iinclude\QtCore\6.1.0 -Iinclude\QtCore\6.1.0\QtCore /DWIN32 /D_WINDOWS /GR /Zi /DNDEBUG -O2 -MD /W3 /EHsc -Zc:__cplusplus -permissive- -utf-8 -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std:c++17 /YuE:/repos/qt5/qtbase/src/testlib/CMakeFiles/Test.dir/cmake_pch.hxx /FpE:/repos/qt5/qtbase/src/testlib/CMakeFiles/Test.dir/./cmake_pch.cxx.pch /FIE:/repos/qt5/qtbase/src/testlib/CMakeFiles/Test.dir/cmake_pch.hxx /showIncludes /Fosrc\testlib\CMakeFiles\Test.dir\qtestresult.cpp.obj /Fdsrc\testlib\CMakeFiles\Test.dir\ /FS -c src\testlib\qtestresult.cpp src\testlib\qtestresult.cpp(77): error C3861: 'qTerminate': identifier not found
Probably removing MinGW from PATH was a step to a right direction, but it still does not compile.
see https://developernote.com/2021/05/building-qt-6-1-0-for-android-on-windows/#windows2 for details.
-
@Dmitriano said in Compiler error C3861: 'qTerminate': identifier not found while building QT 6.1.0 for Windows:
qTerminate
This is only defined when QT_NO_EXCEPTIONS is not defined which you don't want for whatever reason.
It's a bug in qtestresult.cpp:77 which uses this function unconditionally. File a bug report. -
@Christian-Ehrlicher yes, looks like it compiles better without -DQT_NO_EXCEPTIONS=1
reported the bug: https://bugreports.qt.io/browse/QTBUG-93739