Fail to configure Src
-
how can I fix it? Thx
C:\Qt\6.5.3\Src>configure.bat -static -prefix "C:\Qt\6.5.2\msvc2022_64_static" -release
-
cd qtbase
-
C:\Qt\6.5.3\Src\qtbase\configure.bat -top-level -static -prefix "C:\Qt\6.5.2\msvc2022_64_static" -release
-- Windows 10 SDK version:
'C:/Program Files/CMake/bin/cmake.exe' '-DBUILD_SHARED_LIBS=OFF' '-DCMAKE_INSTALL_PREFIX=C:/Qt/6.5.2/msvc2022_64_static' '-DCMAKE_BUILD_TYPE=Release' '-G' 'Ninja' 'C:/Qt/6.5.3/Src'
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- The ASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:22 (project):
No CMAKE_CXX_COMPILER could be found.Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:22 (project):
No CMAKE_C_COMPILER could be found.Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.CMake Error at CMakeLists.txt:22 (project):
No CMAKE_ASM_COMPILER could be found.Tell CMake where to find the compiler by setting either the environment
variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:993 (message):
CMake exited with code 1. -
-
From Visual Studio folder in the start menu run "x64 Native Tools Command Prompt for VS 2022". This will open a command prompt and set up an environment with the necessary compiler paths. Run your commands from this command prompt.
-
@pedisChen you need to add the path to the compiler in environments variables
MINGW32 C:.......\MinGW32\bin for exemple.
After that restart the command prompt and run the configure script again -
@Ronel_qtmaster No, polluting system wide environment with development paths is bad practice. That's what those predefined command prompt scripts I mentioned are. Keep your environment nice and clean and you'll avoid a lot of problems.
-
@Chris-Kawa I understand your point.However when you need to use mingw for many other purposes (not only cmake build) you will need to add it in the environments variables.
-
@Ronel_qtmaster Until, of course, you need two toolchains and then you have to constantly juggle... No, you can set up your environment on the build chain basis, not globally.
Besides, OP clearly is using MSVC, and I've never encountered a setup where you'd need global variables for that. -
@Chris-Kawa Thank for your help,follow your suggestion,I have solved this problem. But now,I also want to compile a 32bit version qt from src by MSVC2022.How can I do that?
-
@pedisChen You already asked it here: https://forum.qt.io/topic/155034/how-to-compile-32bit-qt6-5-3-from-src/ and also got an answer...
-
-
@Christian-Ehrlicher Thank you very much!