Building C++ application for eCos on ARM

998 views Asked by At

I'm looking to build a C++ application for eCos on an ARM processor. My program requires several standard C++ header files such as vector, iostream, list, ...

My question is: how can I achieve this? Does anyone have any experience building and deploying C++ applications for eCos?

When I use the arm-eabi-g++ compiler to compile the application, I get the following error

fatal error: vector: No such file or directory

meaning that the C++ vector library is not present.

However, the arm-none-eabi-g++ compiler does include these standard header files. I do get the following errors for '':

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
...

Can I use the arm-none-eabi-g++ compiler for eCos? If yes, how do I solve these errors? If no, what should I do?

Many thanks in advance!

2

There are 2 answers

0
Rasmi Ranjan Nayak On

vector, list, they are basically belong to Standard template library. For ecos there might be something similar available likewise BOOST. I think u can check this link

0
jayant On

You need ustl. See Using uSTL in eCos applications.

Here's a short example for using vector.

You must include

#include <ustl.h>

Then you may instantiate a vector like so:

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