This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building C++ application for eCos on ARM


Hi,

we also had an own library that uses stl and we managed to build it for eCos uSTL. We did the following

1.
We created an stl compatibility layer: a folder that contains the stl include files for eCos:
vector
string
map
...

2.
Each of these include files contains the same content - it simply includes ustl_compat.h file

#ifndef ustl_compat_vectorH
#define ustl_compat_vectorH
#include "ustl_compat.h"

#endif

3.
The ustl_compat.h file contains the following code:

#ifndef ustl_compatH
#define ustl_compatH
#include <ustl.h>

#define std ustl

#endif // ustl_compatH


So it simply includes the ustl.h header file and defines the preprocessor macro std. So each occurence of std::vector will be replaced by ustl::vector

This worked for us and we could compile the library.






--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]