【问题标题】:using cmake with mingw-w64 error compiling test program使用 cmake 和 mingw-w64 错误编译测试程序
【发布时间】:2016-04-21 13:57:57
【问题描述】:

我正在尝试使用 mingw-w64 和 cmake 进行简单的编译。但由于某种原因,我不能。它无法验证 gcc 是否可以编译一个奇怪的 C 程序。有任何想法吗?

谢谢

保罗

C:\work\opencv\myown\hello>cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CC_COMPILER=gcc
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-5.3.0-win32-seh-rt_v4-rev0/mingw64/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_8ce25\fast"
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-5.3.0-win32-seh-rt_v4-rev0/mingw64/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program
  Files/mingw-w64/x86_64-5.3.0-win32-seh-rt_v4-rev0/mingw64/bin/gcc.exe" is
  not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/work/opencv/myown/hello/CMakeFiles/CMakeTmp



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



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





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


-- Configuring incomplete, errors occurred!
See also "C:/work/opencv/myown/hello/CMakeFiles/CMakeOutput.log".
See also "C:/work/opencv/myown/hello/CMakeFiles/CMakeError.log".

【问题讨论】:

    标签: gcc cmake mingw-w64


    【解决方案1】:

    nmake 在您的PATH 中可用吗?

    您可以使用 CMAKE_MAKE_PROGRAM 提供另一个 make 命令,例如:

    cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CC_COMPILER=gcc -DCMAKE_MAKE_PROGRAM=mingw32-make
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-27
      • 1970-01-01
      • 1970-01-01
      • 2015-05-26
      • 1970-01-01
      • 2023-04-08
      • 2020-07-27
      相关资源
      最近更新 更多