Using parts of STL on lpc2388 ?

At the moment i am looking for some kind of implementation of the STL für arm microcontrollers. Currently i am Using Yagarto, which includes libstdc++.a but im not quite sure what really is within that library.

Is STL implemented? If yes, how to use it e.g. to work with a list?

If not, what would be the best way to build a working implementation. STL port?

looking forward to get some hints ^^

Thorsten F:
At the moment i am looking for some kind of implementation of the STL für arm microcontrollers. Currently i am Using Yagarto, which includes libstdc++.a but im not quite sure what really is within that library.

Is STL implemented?

GNU libstdc++ does contain an STL implementation (remember that the STL is a set of Templates, and requires the header files).

Be warned that the STL will lead to code bloat. I would strongly suggest playing around with -fwhole-program and -combine compilation flags.

#include <list>
int main() 
{
 std::list<int> a;
 a.push_back(1);
}

Ok i found the corresponding headers (just forgot to add the include dir)

What do you mean with those compiler flags?

If i just instantiate an empty list, everything is ok and working. Code size about 5kb. a simple push_back() increases code size to ~64kb and nothing works anymore :frowning:

Anyone has an Idea?

edit: if i disable interworking and just stick to the arm instruction set, code gets even bigger (of course) but it works then!

So seems to be a problem with the thumb/interworking? anyone knows how to solve this?

Have a look at this (an article on my website).

http://www.webalice.it/fede.tft/cpp_on_ … ricks.html

Using my optimized makefile and linker script the following code

#include <list>
#include "system.h"

using namespace std;

int main()
{
    init();

    list<int> l;
    l.push_back(1);

    shutdown();
}

compiles to ~13KB (all ARM, thumb would be even less).