无法在 clion 中运行任何程序

can't run any program in clion

本文关键字:运行 任何 程序 clion      更新时间:2023-10-16

我下载了clion,并在以下位置浏览了jetbeans提供的设置指南:https://www.jetbrains.com/help/clion/2016.3/quick-tutorial-on-configuring-clion-on-windows.html我尝试将cygwin和minGW都设置为环境,但程序无法运行。我遵循了这个问题:如何设置Clion进行编译和运行

我也在路径中附加了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产品时也遇到了一些问题,因为它对我来说很多时候都不起作用。然而,我发现了这个视频:

安装&配置CLion学生副本||C/C++的最佳IDE。

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

只是一个建议,你可以先看看视频,看看你是否犯了任何错误。将视频中的讲师的做法与你的做法进行比较。如果你错过了导入某个包(本视频使用MinGW)之类的东西,那么这就是你错的地方。这样也可以解决问题。如果您无法确定错误,请尝试重新安装。祝您好运!


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

相关文章: