无法在clion中运行任何程序

时间:2017-02-10 23:35:53

标签: c++ windows gcc clion

我下载了clion并浏览了jetbeans提供的设置指南:https://www.jetbrains.com/help/clion/2016.3/quick-tutorial-on-configuring-clion-on-windows.html 我尝试将cygwin和minGW设置为环境,但程序无法运行。我关注了这个问题:How to setup Clion for compile and RUN

我在路径中附加了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]

1 个答案:

答案 0 :(得分:1)

下载CLion产品时我也遇到了一些问题,因为它很多次都不适合我。但是,我随后发现了这段视频:

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

我做的是我卸载了CLion MinGW,我又从头开始了。它可能不是最好的选择,但我无法确定手头的问题,所以我按照上面的视频重新安装它。克里昂现在为我工作。该视频用于在Windows操作系统计算机上安装CLion。

只是推荐,您可以先查看视频,看看是否有任何错误。比较视频中的讲师如何做到这一点。如果您错过了导入某个软件包的任何内容(此视频使用的是MinGW),那么那就是您出错的地方。那也可以解决问题。如果您无法查明错误,请尝试重新安装。祝你好运!

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