c++ - 使用cmake时出现奇怪的错误

标签 c++ cmake wt

<分区>

有谁知道“C 编译器“cl”无法编译简单的测试程序。”是什么意思?
我正在尝试编译 Wt在 MSVC 9 上使用 CMake。
操作系统为Windows XP。
这是完整的日志:

Check for working C compiler: cl Check for working C compiler: cl -- broken CMake Error at I:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE): The C compiler "cl" is not able to compile a simple test program.

It fails with the following output:

Change Dir: I:/SophisPal/build/CMakeFiles/CMakeTmp

Run Build Command:C:\PROGRA~1\MICROS~1.0\Common7\IDE\VCExpress.exe CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec

Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.

Copyright (C) Microsoft Corp 2007. All rights reserved.

1>------ Build started: Project: cmTryCompileExec, Configuration: Debug Win32 ------

1>Compiling...

1>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86

1>Copyright (C) Microsoft Corporation. All rights reserved.

1>cl /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "CMAKE_INTDIR=\"Debug\""
/D "_MBCS" /FD /RTCs /MDd /Fo"cmTryCompileExec.dir\Debug\"
/Fd"I:/SophisPal/build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb" /W3 /c /Zi /TC /Zm1000

1> .\testCCompiler.c

1>testCCompiler.c

1>Compiling manifest to resources...

1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1

1>Copyright (C) Microsoft Corporation. All rights reserved.

1>Linking...

1>Embedding manifest...

1>Project : error PRJ0003 : Error spawning 'cmd.exe'.

1>Build log was saved at
"file://i:\SophisPal\build\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm"

1>cmTryCompileExec - 1 error(s), 0 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

CMake will not be able to correctly generate this project. Call Stack (most recent call first):
CMakeLists.txt:7 (PROJECT)

Configuring incomplete, errors occurred!

最佳答案

我用谷歌搜索了 cmd.exe 错误并找到了 this page .看起来 Visual Studio 需要配置一些路径,以便它知道如何找到 cmd.exe。以下是该线程的步骤:

What you must do is change MSVS options (Tools menu > Options > Project and Solutions > VC++ Directories) to ensure that

$(SystemRoot)

$(SystemRoot)\System32

$(SystemRoot)\System32\wbem

are specified BEFORE $(PATH).

关于c++ - 使用cmake时出现奇怪的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1896505/

相关文章:

c++ - 没有构造函数的类(隐式或显式)

cmake - 为特定目标运行 fixup_bundle (PACKAGE)

c++ - c++ cgi中的Web开发是否真的会带来巨大的性能提升?

c++ - CMake 找不到 VS 14 2015 的 MSBuild.exe

ubuntu - Ubuntu 14.04 上 C/C++ 的 -pthread 和 -pthreads 之间的区别

c++ - 我如何使用内置 Web 服务器部署 Wt 应用程序?

从 Wt 示例错误编译 simpleChat.C

c++ - 将多种(不同)类型的参数传递给模板函数

c++ - 带有 std::map 错误函数调用的 boost::factory

c++ - 在 typedef 结构中声明一个数组