Does anyone know what "The C compiler "cl" is not able to compile a simple test program." means?
I am trying to compile Wt using CMake on MSVC 9.
The OS is Windows XP.
Here is the full log:
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 /Zm10001> .\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!
I googled for the cmd.exe error and came up with this page. Looks like Visual studio needs to be configured with a few paths so it knows how to find cmd.exe. Here are the steps from that thread:
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).
Check if any other tool that you have installed overwrote the PATH variable. In my case this happened and the symptom (link error) was the exact same.
The key line is probably:
1>Project : error PRJ0003 : Error spawning 'cmd.exe'.
For some reason or another, the MSVC is not able to execute 'cmd.exe', and therefore the compilation fails.
I would guess that the problem might be related to the setting of %PATH%; there might be some other reason for the trouble.
Try doing what CMake did manually - see whether you get the same error. This will help you diagnose whether the problem is in CMake (if it does work for you from the command line) or in your general environment (if it does not work for you either).
Learn how to read error messages!
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
These are two of the early lines in the output. The first indicates that CMake changed directory to one of its creating. The second indicates the command it ran there. You would also need to find out what files it created in the directory before running the command.
With that information at hand, you'll have to go through the same steps - 'cd' followed by 'vcexpress'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With