This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Building C++ application for eCos on ARM
- From: cetoni GmbH - Uwe Kindler <uwe dot kindler at cetoni dot de>
- To: ecos-discuss at sourceware dot org, jabran dot tlv at gmail dot com
- Date: Tue, 17 Sep 2013 16:38:51 +0200
- Subject: Re: Building C++ application for eCos on ARM
- Authentication-results: sourceware.org; auth=none
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