无法让CMAKE编译项目

时间:2018-07-10 22:32:50

标签: c++ gcc cmake g++ mingw

这是我遇到的错误:

-- Building for: NMake Makefiles
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_86068\fast"
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/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:/--REDACTED--/CMakeFiles/CMakeTmp



Run Build Command:"nmake" "/NOLOGO" "cmTC_86068\fast"

The system cannot find the file specified

Generator: execution of make failed.  Make command was: "nmake" "/NOLOGO" "cmTC_86068\fast"





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 "C:/--REDACTED--/socket.io-client-cpp-1.6.1/CMakeFiles/CMakeOutput.log".
See also "C:/--REDACTED--/socket.io-client-cpp-1.6.1/CMakeFiles/CMakeError.log".

我正在使用的记录:

    MinGW 4.8.1中的
  • gcc和g ++
  • CMake 3.4.1

我不知道问题可能是什么,我已经在网上进行了广泛浏览,没有发现有人可以找到解决方案的地方,除非它与涉及非拉丁字符的路径问题有关或没有写访问权限,这对于任何有问题的目录都不是这种情况。我很认真地打算完全放弃能够使它正常工作,但是我不知道该怎么办,因为我绝对需要为此项目使用C ++的socket.io客户端。

1 个答案:

答案 0 :(得分:0)

CMake是一个实用程序,可为不同的构建系统生成“ makefile”。在这里,您生成了一个nmake makefile,似乎您的路径中没有nmake。

您可以使用选项-G "MinGW Makefiles"启动CMake,以生成与mingw make兼容的makefile。然后发出命令:

mingw32-make