简体   繁体   English

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

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

Whenever building a C++ source with arm-none-eabi ( -g++ , -gcc , and -c++ ) that includes a stdlib header, gcc says that the file is not found: 每当使用带有stdlib标头的arm-none-eabi-g++ ,- -gcc-c++ )构建C ++源代码时,gcc都会找到该文件:

test.cpp: test.cpp:

#include <set>
#include <cmath>

using namespace std;

int main()
{
    set<int> aSet();
    aSet.insert(abs(-1));
    return 0;
}

output: 输出:

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

System info: 系统信息:
Ubuntu 15.10 Ubuntu 15.10
GCC version 4.9.3 20150529 (prerelease) GCC版本4.9.3 20150529(预发行版)

GCC was looking for files with version 4.9.3, but the newlib installation has the libraries under version 4.9. GCC正在寻找版本4.9.3的文件,但是newlib安装的库版本为4.9。 Symlinking /usr/include/newlib/4.9 to /usr/include/newlib/4.9.3 solves the issue. 符号链接/usr/include/newlib/4.9/usr/include/newlib/4.9.3解决了这个问题。

Thanks to Alex Hoppus for helping me out with debugging 感谢Alex Hoppus帮助我进行调试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM