我正在寻找在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 ++编译器吗?如果是,我该如何解决这些错误?如果不是,我该怎么办?
非常感谢提前!
答案 0 :(得分:0)
vector, list
,它们基本上属于Standard template library
。对于ecos,类似的可能类似BOOST
。
我想你可以查看this link
答案 1 :(得分:0)
您需要ustl
。请参阅Using uSTL in eCos applications。
以下是使用vector
的简短示例。
您必须包含
#include <ustl.h>
然后你可以像这样实例化一个矢量:
ustl::vector<int> v(2);