c++ - CMake编译导致错误

标签 c++ compiler-errors cmake cmake-gui

The C compiler identification is unknown The CXX compiler identification is unknown Check for working C compiler: C:/MinGW/bin/gcc.exe Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/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: C:/SFML-2.2/bin/CMakeFiles/CMakeTmp

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

C:/MinGW/bin/mingw32-make.exe -f
CMakeFiles\cmTryCompileExec3616319305.dir\build.make
CMakeFiles/cmTryCompileExec3616319305.dir/build

mingw32-make.exe[1]: Entering directory
'C:/SFML-2.2/bin/CMakeFiles/CMakeTmp'

"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML-2.2\bin\CMakeFiles\CMakeTmp\CMakeFiles 1

Building C object
CMakeFiles/cmTryCompileExec3616319305.dir/testCCompiler.c.obj

C:\MinGW\bin\gcc.exe -o
CMakeFiles\cmTryCompileExec3616319305.dir\testCCompiler.c.obj -c
C:\SFML-2.2\bin\CMakeFiles\CMakeTmp\testCCompiler.c

CMakeFiles\cmTryCompileExec3616319305.dir\build.make:56: recipe for target
'CMakeFiles/cmTryCompileExec3616319305.dir/testCCompiler.c.obj' failed

mingw32-make.exe[1]: Leaving directory
'C:/SFML-2.2/bin/CMakeFiles/CMakeTmp'

mingw32-make.exe[1]: ***
[CMakeFiles/cmTryCompileExec3616319305.dir/testCCompiler.c.obj] Error 1

Makefile:116: recipe for target 'cmTryCompileExec3616319305/fast' failed

mingw32-make.exe: *** [cmTryCompileExec3616319305/fast] Error 2

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

Configuring incomplete, errors occurred! See also "C:/SFML-2.2/bin/CMakeFiles/CMakeOutput.log". See also "C:/SFML-2.2/bin/CMakeFiles/CMakeError.log".



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

The output was: 1

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

The output was: 1

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

The output was: 1

Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler": gcc.exe: fatal error: no input files compilation terminated. Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: C:/MinGW/bin/g++.exe Build flags: Id flags:

The output was: 1

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: C:/MinGW/bin/g++.exe Build flags: Id flags: -c

The output was: 1

Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler": g++.exe: fatal error: no input files compilation terminated. Determining if the C compiler works failed with the following output: Change Dir: C:/SFML-2.2/bin/CMakeFiles/CMakeTmp

Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTryCompileExec3616319305/fast" C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec3616319305.dir\build.make CMakeFiles/cmTryCompileExec3616319305.dir/build

mingw32-make.exe[1]: Entering directory 'C:/SFML-2.2/bin/CMakeFiles/CMakeTmp'

"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\SFML-2.2\bin\CMakeFiles\CMakeTmp\CMakeFiles 1

Building C object CMakeFiles/cmTryCompileExec3616319305.dir/testCCompiler.c.obj

C:\MinGW\bin\gcc.exe -o CMakeFiles\cmTryCompileExec3616319305.dir\testCCompiler.c.obj -c C:\SFML-2.2\bin\CMakeFiles\CMakeTmp\testCCompiler.c

CMakeFiles\cmTryCompileExec3616319305.dir\build.make:56: recipe for target 'CMakeFiles/cmTryCompileExec3616319305.dir/testCCompiler.c.obj' failed

mingw32-make.exe[1]: Leaving directory 'C:/SFML-2.2/bin/CMakeFiles/CMakeTmp'

mingw32-make.exe[1]: *** [CMakeFiles/cmTryCompileExec3616319305.dir/testCCompiler.c.obj] Error 1

Makefile:116: recipe for target 'cmTryCompileExec3616319305/fast' failed

mingw32-make.exe: *** [cmTryCompileExec3616319305/fast] Error 2

最佳答案

要回答您从未问过的问题……您没有安装CMake能够找到和使用的编译器。安装一个,然后重试。

关于c++ - CMake编译导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29787306/

相关文章:

cmake - 为什么 CMake 不检测对我生成的文件的依赖?

cmake - 添加在 configure_file 中生成的包含 header

c++ - C++多重继承的一些基础知识

iphone - ';' token 错误之前预期的 '('

c++ - 编译 Boost.Log 时出错

user-interface - 将Winsock控制台应用程序迁移到Windows子系统-代码日志

c++ - 这个 pow() 函数在 while 循环 C++ 中发生了什么?

c++ - 使用默认构造函数初始化变量

c++ - 适用于 OSX 和 Linux 的 OpenGL 头文件

cmake - 如何删除 CMake 中的 "the Location property may not be read from target"错误?