简体   繁体   中英

Windows CMake Won't Compile Test Program

I'm trying to setup a C/C++ environment using CLion, but CMake isn't able to compile the test program:

C:\Users\corey\.CLion2016.3\system\cygwin_cmake\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /cygdrive/c/Users/corey/ClionProjects/demo
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working C compiler: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- broken
CMake Error at /cygdrive/c/Users/corey/.CLion2016.3/system/cygwin_cmake/share/cmake-3.6.2/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio
  12.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /cygdrive/c/Users/corey/ClionProjects/demo/cmake-build-debug/CMakeFiles/CMakeTmp



  Run Build Command:"/cygdrive/c/D/dmd2/windows/bin/make.exe"
  "cmTC_2a8fc/fast"

  f CMakeFiles/cmTC_2a8fc.dir/build.make CMakeFiles/cmTC_2a8fc.dir/build

  Error: 'f' not found





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


-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/Users/corey/ClionProjects/demo/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/corey/ClionProjects/demo/cmake-build-debug/CMakeFiles/CMakeError.log".

I'm running Windows 10 and VC 12.0 (Visual Studio 2013?). I've tried setting CLion up to use cygwin cmake instead of the built in version, and I've tried reinstalling all relevant tools, with no success.

Figured it out - missed it the first few times in the output - I have D lang DMD installed, which has it's own make.exe for whatever reason. CMake was selecting this make executable for whatever reason by default, rather than the one in cygwin. Either uninstalling DMD or manually configuring CMake to use the cygwin make fixes the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM