【问题标题】:Building C++ application for eCos on ARM在 ARM 上为 eCos 构建 C++ 应用程序
【发布时间】:2013-08-29 14:30:50
【问题描述】:

我希望在 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++ 编译器吗?如果是,我该如何解决这些错误?如果没有,我该怎么办?

非常感谢!

【问题讨论】:

    标签: c++ vector arm eabi ecos


    【解决方案1】:

    vector, list,基本上都属于Standard template library。对于生态系统,BOOST 也可能有类似的东西可用。 我想你可以查看this link

    【讨论】:

      【解决方案2】:

      您需要ustl。见Using uSTL in eCos applications

      这是一个使用vector的简短示例。

      你必须包括

      #include <ustl.h>
      

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

      ustl::vector<int> v(2);
      

      【讨论】:

        猜你喜欢
        • 2013-08-13
        • 1970-01-01
        • 1970-01-01
        • 2017-08-05
        • 1970-01-01
        • 2012-01-01
        • 1970-01-01
        • 2013-08-30
        • 1970-01-01
        相关资源
        最近更新 更多