【问题标题】:CMake with mingw on Windows 10: Detecting CXX compiler ABI info - failed在 Windows 10 上使用 mingw 进行 CMake:检测 CXX 编译器 ABI 信息 - 失败
【发布时间】:2018-01-07 21:01:12
【问题描述】:

我想使用 cmake 在 Windows 10 上创建 MinGW Makefile。我已经安装了 mingw,我可以毫无问题地使用 mingw32-make 和 g++ 命令。

测试项目是一个超级简单的CMakeLists.txt文件:

cmake_minimum_required(VERSION 3.10)
project(hello-world)
add_executable(hello-world main.cpp)

还有一个简单的 main.cpp 文件:

#include <iostream>
int main() {
    std::cout << "hello Visual Studio Code! :)" << '\n'; 
    return 0;
}

这些是我用来创建 makefile 的命令:

>> mkdir build
>> cd build
>> cmake -G "MinGW Makefiles" ..

这是我得到错误的地方:

CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/CMakeDetermineCompilerId.cmake:495 (file):
file STRINGS file
"C:/Projects/test/build/CMakeFiles/3.10.1/CompilerIdCXX/a.exe" cannot be read.

... some more errors in the test files

-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!

这是来自错误日志:

The CXX compiler identification could not be found in "C:/Projects/test/build/CMakeFiles/3.10.1/CompilerIdCXX/a.exe"

什么是 CXX 编译器 ABI 信息,如何检测到工作的 CXX 编译器但失败?

如果您需要有关设置的更多信息,请告诉我!

【问题讨论】:

  • 第一个错误之后的错误可能是由第一个错误引起的 - 看起来像是缺少或错误的构建链组件。

标签: c++ cmake windows-10 mingw


【解决方案1】:

原来是我的罪魁祸首是 Windows Defender!将其关闭,CXX 编译器 ABI 信息 - 失败问题就消失了。

【讨论】:

  • 建议应作为评论添加。
【解决方案2】:

我使用 CMake-GUI 工具找出缺少的工具依赖项。例如: CMAKE_ADDR2LINE 没有设置,一旦我将它指向正确的位置 addr2line.exe ,错误就解决了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-18
    • 1970-01-01
    • 1970-01-01
    • 2017-10-05
    • 1970-01-01
    • 2015-02-13
    • 2015-01-22
    相关资源
    最近更新 更多