0

我正在寻找在 ARM 处理器上为 eCos 构建 C++ 应用程序。我的程序需要几个标准的 C++ 头文件,例如 vector、iostream、list、...

我的问题是:我怎样才能做到这一点?有没有人有为 eCos 构建和部署 C++ 应用程序的经验?

当我使用 arm-eabi-g++ 编译器编译应用程序时,出现以下错误

fatal error: vector: No such file or directory

意味着不存在 C++ 向量库。

但是,arm-none-eabi-g++ 编译器确实包含这些标准头文件。我确实收到以下错误:

In file included from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/bits/locale_facets.h:43:0,
             from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/bits/basic_ios.h:39,
             from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/ios:45,
             from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/ostream:40,
             from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/iostream:40,
/opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/arm-none-eabi/bits/ctype_base.h:44:35: error: '_U' was not declared in this scope
/opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/arm-none-eabi/bits/ctype_base.h:45:32: error: '_L' was not declared in this scope
/opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/arm-none-eabi/bits/ctype_base.h:46:32: error: '_U' was not declared in this scope
...

我可以为 eCos 使用 arm-none-eabi-g++ 编译器吗?如果是,我该如何解决这些错误?如果没有,我该怎么办?

提前谢谢了!

4

2 回答 2

0

vector, list,他们基本上都属于Standard template library。对于生态系统,可能也有类似的东西可用BOOST。我想你可以检查这个链接

于 2013-08-29T14:40:24.420 回答
0

你需要ustl. 请参阅在 eCos 应用程序中使用 uSTL

这是一个使用vector.

您必须包括

#include <ustl.h>

然后你可以像这样实例化一个向量:

ustl::vector<int> v(2);
于 2015-10-13T20:27:55.553 回答