【问题标题】:Cmake with MinGW fails compile test带有 MinGW 的 Cmake 无法通过编译测试
【发布时间】:2012-03-06 14:13:28
【问题描述】:

我正在尝试在 Windows 上使用 CMAKE 和 MinGW 在 Windows 上编译 OpenCV。但是,当我尝试这样做时,出现以下错误:

The C compiler identification is GNU
The CXX compiler identification is GNU
Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: make "cmTryCompileExec\fast"
Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test program.

有谁知道可能是什么问题?

【问题讨论】:

  • 我遇到了类似的错误。我的问题是 MinGW 安装不完整。据我回忆,gcc 根本就不见了。

标签: winforms cmake mingw gnu


【解决方案1】:

您是在 MinGW shell 中还是在 CMD.exe 中运行 CMAKE?我可以给你的第一个建议是使用 MinGW shell,因为这样可以更好地为编译器设置几个环境变量。否则你可能需要稍微调整一下你的 windows 环境变量。

您可能还安装了 Cygwin(并且还在 cygwin 中安装了 gcc)。在这种情况下,如果你使用CMD.exe,并且系统PATH变量中Cygwin的bin目录比MinGW的bin目录先读取,也会出现这种错误。

【讨论】:

    猜你喜欢
    • 2020-05-31
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-17
    • 2021-03-18
    • 1970-01-01
    相关资源
    最近更新 更多