【问题标题】:Clion and cmake compile errorClion和cmake编译错误
【发布时间】:2017-06-06 18:17:44
【问题描述】:

我正在尝试使用带有 Cmake 和 MinGW 的 Clion 设置环境。我在 clion 中配置,但是当我刷新时,我得到了下面的错误。我应该提到我是 C/C++ 的新手,但我已经按照说明设置所需的东西,但由于某种原因它不起作用。我要编辑的是vox引擎的一个分支。我已经搜索了错误,但没有一个对我有帮助。

我尝试设置路径 C:\MinGW\bin,将工作目录移动到名称中没有空格的地方。我也尝试过其他一些方法,但具体记不清了。

"D:\Gustav Olsson\Program\CLion 2016.3.2\bin\cmake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" "D:\Gustav Olsson\Programming\Voxel"
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: "C:/MinGW/bin/mingw32-make.exe" "cmTC_f8fdc/fast"
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at D:/Gustav Olsson/Program/CLion 2016.3.2/bin/cmake/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: D:/Gustav Olsson/Programming/Voxel/CMakeFiles/CMakeTmp



  Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_f8fdc/fast"



  Generator: execution of make failed.  Make command was:
  "C:/MinGW/bin/mingw32-make.exe" "cmTC_f8fdc/fast"





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


-- Configuring incomplete, errors occurred!
See also "D:/Gustav Olsson/Programming/Voxel/CMakeFiles/CMakeOutput.log".
See also "D:/Gustav Olsson/Programming/Voxel/CMakeFiles/CMakeError.log".

编辑: 输出 CMakeOutput.log 的最后几行

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.exe"

The CXX compiler identification is GNU, found in "D:/Gustav Olsson/Programming/Voxel/CMakeFiles/3.6.3/CompilerIdCXX/a.exe"

Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: C:/MinGW/bin/gcc.exe 
Build flags: 
Id flags: 

The output was:
0

输出 CMakeError.log

Determining if the C compiler works failed with the following output:
Change Dir: D:/Gustav Olsson/Programming/Voxel/CMakeFiles/CMakeTmp

Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_ae556/fast"

Generator: execution of make failed. Make command was: "C:/MinGW/bin/mingw32-make.exe" "cmTC_ae556/fast"


Determining if the C compiler works failed with the following output:
Change Dir: D:/Gustav Olsson/Programming/Voxel/CMakeFiles/CMakeTmp

Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_f8fdc/fast"

Generator: execution of make failed. Make command was: "C:/MinGW/bin/mingw32-make.exe" "cmTC_f8fdc/fast"


Determining if the C compiler works failed with the following output:
Change Dir: D:/Gustav Olsson/Programming/Voxel/CMakeFiles/CMakeTmp

Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_3f00c/fast"

Generator: execution of make failed. Make command was: "C:/MinGW/bin/mingw32-make.exe" "cmTC_3f00c/fast"

提前感谢您的帮助

【问题讨论】:

  • I'm trying to set up an environment using Clion with Cmake and MinGW. - 但是您调用 cmake 来生成 CodeBlocks 项目:-G "CodeBlocks - MinGW Makefiles"。您显示的输出末尾有“另请参阅”行。你看过这些文件吗?将文件D:/Gustav Olsson/Programming/Voxel/CMakeFiles/CMakeError.log 的内容添加到您的问题帖子中。
  • @Tsyvarev 感谢您的回复,我发布了文件的输出,如何将 ' -G "CodeBlocks - MinGW Makefiles" ' 更改为 Clion 而不是 CodeBlocks?
  • 没有您可能想象的 Clion 生成器,即使在最新的 CMake 中也是如此,因此您不能更改例如(我认为您可以想象这样做)-G "CodeBlocks - MinGW Makefiles"-G "Clion - MinGW Makefiles"!跨度>
  • 所以在生成器支持 Clion 之前,没有办法让 Clion 编译/运行?

标签: cmake mingw clion


【解决方案1】:

我从 mingw-14.1 下载并安装了 mingw-14.1,并通过我现有的 MinGW 消除了编译测试文件的错误

【讨论】:

    猜你喜欢
    • 2017-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-30
    • 2023-01-27
    • 1970-01-01
    • 2021-03-24
    • 2015-06-29
    相关资源
    最近更新 更多