Hi all,
I'm working on a small embedded project running on Linux. A fair chunk of the application code expected to be run is written in "embedded" C++, ie using objects and classes, but not using resource hungry C++ stuff such as templates or exceptions. It's basically just object-oriented C code.
My problem is that the GNU C++ library is very large. It would be more convenient to link just the symbols in the C++ library that are actually used. Is there a way to do this ? I have tried using the --static option on g++, but on an example "hello world" program that gives me a 0.5MB executable on my Solaris box. Adding the -s option reduces this to about
0.25MB. It doesn't seem likely that the executable needs to be this big, it looks like it's just lumping the whole library in. I'd not expect the printf() or exit() functions to reach more than some tens of KB, and the startup/cleanup code can't be that huge either.Has anyone encountered this problem before ?