我试图在运行Windows 10的计算机上安装一组可执行文件,并且在下载源代码之后,我需要使用cmake编译它们。我下载了最新版本的CMake的,和(设置适当的工作目录后)一直在努力,以安装可执行文件运行在Windows命令提示符下输入以下命令:为什么cmake没有找到编译器cl
mkdir build
cd build
cmake ../
make
然而,cmake的一贯命令产生以下错误,并不能产生任何形式的make文件中的make命令可以使用:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
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:2 (project):
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
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.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Hannah/Documents/nupack3.2.0/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Hannah/Documents/nupack3.2.0/build/CMakeFiles/CMakeError.log".
我已经尝试了许多解决方案,为cmake的工作,和他们都没有工作。我试图将我的cmake文件夹的bin添加到我的PATH环境变量中,我试图重新安装我的cmake副本,并尝试使用CMake GUI来生成make文件(Running CMake on Windows),甚至下载Visual Studio (How to set cmake CXX variable on windows),但因为我没有足够的经验来使用CMake GUI或Visual Studio,或者因为还有其他问题,所以似乎没有任何工作,cmake ../
产生完全相同的错误。
任何人都可以为我提供一些备用解决方案,以便如何使此命令有效吗?
***在Windows命令提示符下***我将使用您正在使用的Visual Studio版本的Visual Studio命令提示符。或者至少在命令提示符下执行vcvarsall.bat。这就是说你不要在Visual Studio中使用'make'。 – drescherjm
你在CMake中使用了什么发电机?你使用什么编译器? – drescherjm
***我试图将我的cmake文件夹的bin添加到我的PATH环境变量中***我的窗口中有我的路径中的CMake bin。我每天在一台半打电脑上用Visual Studio进行CMake。 – drescherjm