Error on Qt 6 Building from source for Windows Based
-
@Lemat said in Error on Qt 6 Building from source for Windows Based:
"C:\PROGRA~2\Microsoft Visual Studio\2019\COMMUN~1\VC\AUXILI~1\Build\vcvars64.bat" -o CMakeFiles\cmTC_ea43b.dir\CMakeCXXCompilerABI.cpp.obj -c "C:\Program Files\CMake\share\cmake-3.18\Modules\CMakeCXXCompilerABI.cpp"
This looks strange. This should be the call to the compiler, but instead vcvars64.bat is called. Can you show your script you created as described in the link (qt6vars.cmd)?
My qt6vars.cmd:
REM Set up Microsoft Visual Studio 2019, where <arch> is amd64, x86, etc.
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
SET _ROOT=C:\Qt\Qt-6
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
REM Uncomment the below line when using a git checkout of the source repository
REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
SET _ROOT= -
i followed this link' instructions to build Qt 6.0.0 from qt-everywhere-src.zip, but i get these errors:
https://doc.qt.io/qt-6/windows-building.htmlI am using MSVC 2019.
error:
C:\Qt\Qt-6>configure.bat -prefix c:\Qt\Qt6
-
cd qtbase
-
C:\Qt\Qt-6\qtbase\configure.bat -top-level -prefix c:\Qt\Qt6
'C:/Program Files/CMake/bin/cmake.exe' '-DCMAKE_INSTALL_PREFIX=c://Qt//Qt6' '-G' 'Ninja' 'C:/Qt/Qt-6'
-- The C compiler identification is MSVC 19.28.29336.0
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Qt/Qt-6/CMakeFiles/CMakeTmp
Run Build Command(s):C:/ninja-win/ninja.exe cmTC_00c4b && [1/2] Building C object CMakeFiles\cmTC_00c4b.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_00c4b.exe
FAILED: cmTC_00c4b.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_00c4b.dir --rc=rc --mt="" --manifests -- "C:\PROGRA~2\Microsoft Visual Studio\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cmTC_00c4b.dir\testCCompiler.c.obj /out:cmTC_00c4b.exe /implib:cmTC_00c4b.lib /pdb:cmTC_00c4b.pdb /version:0.0 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /fo CMakeFiles\cmTC_00c4b.dir/manifest.res CMakeFiles\cmTC_00c4b.dir/manifest.rc" failed (exit code 0) with the following output:
Le fichier sp├®cifi├® est introuvable
ninja: build -- Configuring incomplete, errors occurred!
stopped: subcommand failed.CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:11 (project)
See also "C:/Qt/Qt-6/CMakeFiles/CMakeOutput.log".
See also "C:/Qt/Qt-6/CMakeFiles/CMakeError.log".
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:788 (message):
CMake exited with code 1.C:\Qt\Qt-6>
@Lemat said in Error on Qt 6 Building from source for Windows Based:
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
I'm not very familiar with Windows build environment, but is that OK?
I mean, it looks like the 64 bit version of cl.exe is being used, but it's strange that the Visual Studio installation went to the x86 folder, as a 32 bit application?Could you please describe your environment? i.e. Windows OS version and platform, same for Visual Studio.
-
-
@jsulm
owww !!, that is the CXX variable i set in system environment. i should change it to vcvarsall.bat -
@Lemat said in Error on Qt 6 Building from source for Windows Based:
C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
I'm not very familiar with Windows build environment, but is that OK?
I mean, it looks like the 64 bit version of cl.exe is being used, but it's strange that the Visual Studio installation went to the x86 folder, as a 32 bit application?Could you please describe your environment? i.e. Windows OS version and platform, same for Visual Studio.
-
@Lemat said in Error on Qt 6 Building from source for Windows Based:
"C:\PROGRA~2\Microsoft Visual Studio\2019\COMMUN~1\VC\AUXILI~1\Build\vcvars64.bat" -o CMakeFiles\cmTC_ea43b.dir\CMakeCXXCompilerABI.cpp.obj -c "C:\Program Files\CMake\share\cmake-3.18\Modules\CMakeCXXCompilerABI.cpp"
This looks strange. This should be the call to the compiler, but instead vcvars64.bat is called. Can you show your script you created as described in the link (qt6vars.cmd)?
-
or what is the right compiler path ? this one ?: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64
-
@Lemat I think that path is correct. Visual Studio itself is a x86 application, but it has compiler which generates x86_64 binaries.
-
should i set a real compiler path in the system environment variable CXX ?? i don't know the real compiler file name. my actual Qt 5.15.2 has detected it automatically. i am looking in her settings to find the compiler file name, but nothing.
-
Hi,
IIRC, cmake 3.19.2 or newer is recommended but I don't have the source at hand.
-
You should update your cmake version.
-
Did you restart from a clean state ?
-
What did you do to ensure a clean state ?