不能 运行 clion 中的任何程序

can't run any program in clion

我下载了 clion 并完成了 jetbeans 提供的安装指南:https://www.jetbrains.com/help/clion/2016.3/quick-tutorial-on-configuring-clion-on-windows.html 我尝试将 cygwin 和 minGW 都设置为环境,但程序不会 运行。我关注了这个问题:

我也在路径中附加了 cygwin 和 minGW 的目录,但我仍然无法 运行 我的程序。

它引发了一个很长的错误:

CMake Error at /cygdrive/c/Users/dell/.CLion2016.3/system/cygwin_cmake/share/cmake-3.6.3/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/cygdrive/c/MinGW/bin/gcc.exe" is not able to compile a
  simple test program.

失败并输出以下内容:

   Change Dir: /cygdrive/c/Users/dell/Desktop/jetBeans/c_c++/cmake-build-debug/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/make.exe" "cmTC_2284f/fast"

  /usr/bin/make -f CMakeFiles/cmTC_2284f.dir/build.make
  CMakeFiles/cmTC_2284f.dir/build

  make[1]: Entering directory
  '/cygdrive/c/Users/dell/Desktop/jetBeans/c_c++/cmake-build-debug/CMakeFiles/CMakeTmp'


  Building C object CMakeFiles/cmTC_2284f.dir/testCCompiler.c.o

  /cygdrive/c/MinGW/bin/gcc.exe -o
  CMakeFiles/cmTC_2284f.dir/testCCompiler.c.o -c
  /cygdrive/c/Users/dell/Desktop/jetBeans/c_c++/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c


  gcc.exe: error:
  /cygdrive/c/Users/dell/Desktop/jetBeans/c_c++/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c:
  No such file or directory

  gcc.exe: fatal error: no input files

  compilation terminated.

  make[1]: *** [CMakeFiles/cmTC_2284f.dir/build.make:66:
  CMakeFiles/cmTC_2284f.dir/testCCompiler.c.o] Error 1

  make[1]: Leaving directory
  '/cygdrive/c/Users/dell/Desktop/jetBeans/c_c++/cmake-build-debug/CMakeFiles/CMakeTmp'


  make: *** [Makefile:126: cmTC_2284f/fast] Error 2





  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/dell/Desktop/jetBeans/c_c++/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/dell/Desktop/jetBeans/c_c++/cmake-build-debug/CMakeFiles/CMakeError.log".

[Previous CMake output restored: 11-02-2017 04:45]

我在下载 CLion 产品时也遇到了一些问题,因为它很多时候对我不起作用。然而,我随后发现了这个视频:

Install & Configure CLion Student Copy|| best IDE for C/C++.

我所做的就是卸载了CLion MinGW,然后又从头开始。这可能不是最好的选择,但我无法查明手头的问题,所以我 re-installed 按照上面的视频解决了问题。 CLion 现在为我工作。该视频用于在 windows 操作计算机上安装 CLion。

只是一个推荐,大家可以先看看视频看看有没有看错。比较视频中讲师的做法与您的做法。如果您错过了导入某个包(此视频使用 MinGW)之类的任何操作,那么您就错了。那也可以解决问题。如果您无法查明错误,请尝试 re-installing。祝你好运!


编辑:为什么要安装 MinGW 和 cygwin?你只需要其中之一。