Error while Building Qt 6.8.2 from Source
-
wrote on 5 Mar 2025, 10:53 last edited by
@Christian-Ehrlicher Hi, I am using Visual Studio 2022 compiler
-
wrote on 5 Mar 2025, 11:02 last edited by
The C++ compiler
"C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe"
is not able to compile a simple test program.
-
Please post the full output. Above you are not using 2022. Make sure to use a clean build dir and the correct visual studio command prompt.
-
The C++ compiler
"C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe"
is not able to compile a simple test program.
@dan1973 Do you use the preconfigured MSVC terminal?
-
Please post the full output. Above you are not using 2022. Make sure to use a clean build dir and the correct visual studio command prompt.
wrote on 5 Mar 2025, 11:44 last edited by dan1973 9 days ago@Christian-Ehrlicher
D:\Dev\Qt\src>configure -debug-and-release-
D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release
-- Windows 10 SDK version:
'C:/Program Files/CMake/bin/cmake.exe' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-DCMAKE_CONFIGURATION_TYPES=Release;Debug' '-G' 'Ninja Multi-Config' 'D:/Dev/Qt/src'
-- The CXX compiler identification is MSVC 19.35.32217.1
-- The C compiler identification is MSVC 19.35.32217.1
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler"C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'D:/Dev/Qt/src/CMakeFiles/CMakeScratch/TryCompile-uw7b8x'
Run Build Command(s): C:/PROGRA~1/Ninja/ninja.exe -v -f build-Release.ninja cmTC_81e20
[1/2] C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe /nologo /TP -DCMAKE_INTDIR="Release" /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -MD /showIncludes /FoCMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_81e20.dir\Release\ /FS -c D:\Dev\Qt\src\CMakeFiles\CMakeScratch\TryCompile-uw7b8x\testCXXCompiler.cxx
[2/2] C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: Release/cmTC_81e20.exe
C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1327) with the following output:RC : fatal error RC1106 : invalid option: -ologo
LINK : fatal error LNK1327: failure during running rc.exe
ninja: build stopped: subcommand failed.CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:15 (project)
-- Configuring incomplete, errors occurred!
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1139 (message):
CMake exited with code 1.CMake Error at cmake/QtIRProcessHelpers.cmake:173 (message):
D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release exited
with status: 1Call Stack (most recent call first):
cmake/QtTopLevelHelpers.cmake:35 (qt_ir_execute_process_and_log_and_handle_error)
cmake/QtTopLevelHelpers.cmake:57 (qt_tl_run_toplevel_configure)
cmake/QtTopLevelConfigureScript.cmake:17 (qt_tl_run_main_script)D:\Dev\Qt\src>
///////////
i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable -
-
@Christian-Ehrlicher
D:\Dev\Qt\src>configure -debug-and-release-
D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release
-- Windows 10 SDK version:
'C:/Program Files/CMake/bin/cmake.exe' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-DCMAKE_CONFIGURATION_TYPES=Release;Debug' '-G' 'Ninja Multi-Config' 'D:/Dev/Qt/src'
-- The CXX compiler identification is MSVC 19.35.32217.1
-- The C compiler identification is MSVC 19.35.32217.1
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler"C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'D:/Dev/Qt/src/CMakeFiles/CMakeScratch/TryCompile-uw7b8x'
Run Build Command(s): C:/PROGRA~1/Ninja/ninja.exe -v -f build-Release.ninja cmTC_81e20
[1/2] C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe /nologo /TP -DCMAKE_INTDIR="Release" /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -MD /showIncludes /FoCMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_81e20.dir\Release\ /FS -c D:\Dev\Qt\src\CMakeFiles\CMakeScratch\TryCompile-uw7b8x\testCXXCompiler.cxx
[2/2] C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: Release/cmTC_81e20.exe
C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1327) with the following output:RC : fatal error RC1106 : invalid option: -ologo
LINK : fatal error LNK1327: failure during running rc.exe
ninja: build stopped: subcommand failed.CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:15 (project)
-- Configuring incomplete, errors occurred!
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1139 (message):
CMake exited with code 1.CMake Error at cmake/QtIRProcessHelpers.cmake:173 (message):
D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release exited
with status: 1Call Stack (most recent call first):
cmake/QtTopLevelHelpers.cmake:35 (qt_ir_execute_process_and_log_and_handle_error)
cmake/QtTopLevelHelpers.cmake:57 (qt_tl_run_toplevel_configure)
cmake/QtTopLevelConfigureScript.cmake:17 (qt_tl_run_main_script)D:\Dev\Qt\src>
///////////
i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable@dan1973 said in Error while Building Qt 6.8.2 from Source:
i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable
This is wrong. Use the correct visual studio command prompt from your start menu as we already told you...
-
-
@dan1973 said in Error while Building Qt 6.8.2 from Source:
i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable
This is wrong. Use the correct visual studio command prompt from your start menu as we already told you...
wrote on 5 Mar 2025, 12:01 last edited by@Christian-Ehrlicher how to do this?
-
wrote on 5 Mar 2025, 12:06 last edited by
i am able to open Developer command prompt for VS 2022.
But from here how to run config command? -
wrote on 5 Mar 2025, 12:10 last edited by
C:\Program Files\Microsoft Visual Studio\2022\Professional>configure.bat -debug-and-release
Access is denied.
CMake Error at D:/Dev/Qt/src/cmake/QtWriteArgsFile.cmake:21 (file):
file failed to open for reading (No such file or directory):C:/Program Files/Microsoft Visual Studio/2022/Professional/config.tl.opt.in
CMake Error at D:/Dev/Qt/src/cmake/QtIRCommandLineHelpers.cmake:261 (file):
file STRINGS file "C:/Program Files/Microsoft Visual
Studio/2022/Professional/config.tl.opt" cannot be read.
Call Stack (most recent call first):
D:/Dev/Qt/src/cmake/QtIRCommandLineHelpers.cmake:295 (qt_ir_get_raw_args_from_optfile)
D:/Dev/Qt/src/cmake/QtIRHelpers.cmake:349 (qt_ir_process_args_from_optfile)
D:/Dev/Qt/src/cmake/QtTopLevelHelpers.cmake:51 (qt_ir_run_main_script)
D:/Dev/Qt/src/cmake/QtTopLevelConfigureScript.cmake:17 (qt_tl_run_main_script)Could Not Find C:\Program Files\Microsoft Visual Studio\2022\Professional\config.tl.opt.in
Could Not Find C:\Program Files\Microsoft Visual Studio\2022\Professional\config.tl.optC:\Program Files\Microsoft Visual Studio\2022\Professional>
-
Now tell us why you want to build Qt in your visual studio installation directory...
Create a proper build dir.Why do you want to compile Qt by yourself at all?
-
Now tell us why you want to build Qt in your visual studio installation directory...
Create a proper build dir.Why do you want to compile Qt by yourself at all?
wrote on 7 Mar 2025, 12:09 last edited by@Christian-Ehrlicher i want to install qt 6.2.8 in my folder D:\dev\Qt\Qt6
-
@Christian-Ehrlicher i want to install qt 6.2.8 in my folder D:\dev\Qt\Qt6
@dan1973 said in Error while Building Qt 6.8.2 from Source:
i want to install qt 6.2.8 in my folder D:\dev\Qt\Qt6
This does not answer @Christian-Ehrlicher questions...
First: do not build inside visual studio installation directory.
Second: are you sure you have to build Qt by yourself instead of using Qt Online Installer to install Qt? -
12/14