我在Windows 7中使用cmake和ninja。直到我打开旧版本的IDE为止,它都可以完美工作。现在,cmake使用错误的编译器。代替 C:/程序文件(x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe,现在它尝试使用C:/程序文件(x86)/ Embarcadero / RAD Studio / 9.0 / bin / bcc32x.exe。 当然,我在此处阅读有关stackoverflow的类似问题,并尝试了此处描述的解决方案,但似乎没有任何效果(例如,How do you set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER for building Assimp for iOS?)。即使重新安装cmake也无济于事。我的Windows环境变量还可以。
当我尝试像这样在命令行中设置CMake变量时:
cmake -G Ninja -D CMAKE_C_COMPILER="C:\\Program Files
(x86)\\Embarcadero\\Studio\\19.0\\bin\\bcc32x.exe" -D
CMAKE_CXX_COMPILER="C:\\Program Files (x86)\\Embarcadero\\Studio\\19.0
\\bin\\bcc32x.exe"
cmd输出原为
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\cld>cd c:\
c:\>cmake -G Ninja -D CMAKE_C_COMPILER="C:\\Program Files
(x86)\\Embarcadero\\Studio\\19.0\\bin\\bcc32x.exe" -D
CMAKE_CXX_COMPILER="C:\\Program Files (x86)\\Embarcadero\\Studio\\19.0
\\bin\\bcc32x.exe"
C:\Users\cld\Desktop\smallCmakeTest
-- The C compiler identification is Embarcadero 7.30.36015
-- The CXX compiler identification is Embarcadero 7.30.36015
-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/RAD
Studio/9.0/bin/bcc32x.exe
-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/RAD
Studio/9.0/bin/bcc32x.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules
/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/Program Files (x86)/Embarcadero/RAD Studio/9.0/bin/bcc32x.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/cld/Desktop/smallCmakeTest/CMakeFiles/CMakeTmp
Run Build Command:"C:/ninja/ninja.exe" "cmTC_c1b2f"
[1/2] Building C object CMakeFiles\cmTC_c1b2f.dir\testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_c1b2f.dir/testCCompiler.c.obj
"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin\bcc32x.exe"
-I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\include\windows\crtl"
-I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\
include\windows\sdk" -I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0
\include\windows\rtl" -I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0
\include\dinkumware64" -tM -O0 -v -oCMakeFiles\cmTC_
c1b2f.dir\testCCompiler.c.obj -c testCCompiler.c
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
CMake Error at CMakeLists.txt:1 (project):
The CMAKE_CXX_COMPILER:
C:/Program Files (x86)/Embarcadero/RAD Studio/9.0/bin/bcc32x.exe
is not a full path to an existing compiler tool.
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 Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.10)
should be added at the top of the file. The version specified may be
lower
if you wish to support older CMake versions for this project. For
more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "C:/Users/cld/Desktop/smallCmakeTest/CMakeFiles
/CMakeOutput.log".
See also "C:/Users/cld/Desktop/smallCmakeTest/CMakeFiles
/CMakeError.log".