This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

使用SDK开发C++应用的问题(编译器找不到头文件)



Hello,

       我们使用am335x的SDK(03.02.00.05)开发c和c++应用,目前遇到的问题是c应用能编译通过并在BBB的板子上正常运行,但c++应用编译时提示找不到头文件。c和c++应用的测试代码和编译指令分别如下:

-------------------------------------------------- 正常的c代码和编译指令----------------------------------------------------

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
    printf("Hello, world.\n");
}

编译指令:

# arm-linux-gnueaibhf-gcc main.cpp -o main -sysroot=$MY_ROOTFS

## MY_ROOTFS是ti sdk里提供的full rootfs

---------------------------------------------------------------------------------------------------------------------------------------------

----------------------------- 发生错误的c++代码和编译指令----------------------------------------------------------------------

#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
    cout << "Hello, world." << endl;
}

---------------------------------------------

# 编译指令

# arm-linux-gnueabihf-g++ main.cpp -o main --sysroot=$MY_ROOTFS

main.cpp:1:20: fatal error: iostream: No such file or directory
compilation terminated.

编译器是sdk自带的,版本5.3.1。