Windows CMake 不会编译测试程序



我正在尝试使用CLION设置C/C 环境,但是CMAKE无法编译测试程序:

C:Userscorey.CLion2016.3systemcygwin_cmakebincmake.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".

我正在运行Windows 10和VC 12.0(Visual Studio 2013?)。我已经尝试将Clion设置为使用Cygwin Cmake而不是内置版本,并且我尝试重新安装所有相关工具,但没有成功。

弄清楚了 - 在输出中的前几次错过了它 - 我安装了lang dmd,无论出于何种原因,它都有其自己的make.exe。Cmake默认情况下,出于否认而不是Cygwin中的那个,因此选择此功能可执行。卸载DMD或手动配置Cmake使用Cygwin Make Finises解决问题。

最新更新