arm-none-eabi-g++ 找不到 stdc++ 标头

arm-none-eabi-g++ can't find stdc++ headers

本文关键字:标头 stdc++ 找不到 arm-none-eabi-g++      更新时间:2023-10-16

每当使用包含 stdlib 标头的 arm-none-eabi-g++-gcc-c++)构建C++源时,gcc 都会说找不到该文件:

测试.cpp:

#include <set>
#include <cmath>
using namespace std;
int main()
{
    set<int> aSet();
    aSet.insert(abs(-1));
    return 0;
}

输出:

test.cpp:1:15: fatal error: set: No such file or directory
 #include <set>
               ^
compilation terminated.

系统信息:
乌班图15.10
GCC 版本 4.9.3 20150529(预发行版)

GCC 正在寻找 4.9.3 版本的文件,但 newlib 安装具有 4.9 版本的库。将/usr/include/newlib/4.9符号链接到/usr/include/newlib/4.9.3可以解决此问题。

感谢 Alex Hoppus 帮助我进行调试