Maurice <[EMAIL PROTECTED]>,
  In a message on Wed, 25 May 2005 23:59:35 +0200, wrote :

M> Hello,
M> 
M> for an embedded system I would like to write in C++ using
M> gcc 2.95 but without linking to libstdc++ (its too big).
M> I wonder how far this is possible:
M> 
M>   struct Foo {
M>       Foo(){}
M>       ~Foo(){}
M>   };
M>   int main() { Foo a; }
M> 
M>   $ g++ -nodefaultlibs -fno-exceptions -lc a.cc
M> 
M>   In function `Foo::~Foo(void)':
M>   ... undefined reference to `__builtin_delete'
M> 
M> Without this destructor there is no problem. But C++ without
M> using destructors... thats not funny either.
M> 
M> Is there anything I can do?

You are going to need *some flavor* of libstdc++ and libgcc. 
Fortunately, you have the sources to both available.  What you need to
do is build a restricted version of these libraries, tailored to your
embedded system.  Your restricted version of these libraries will
include necessary pieces like __builtin_delete (which you need), but
not include all of the other pieces you don't need or want.  You will
end up with *small* versions of libstdc++ and libgcc.  You may also need
a specially crafted set of header files too.  Basically, you are
building a cross-build system for a new target (your embedded system).

M> Thank you.
M>                                        

                                     \/
Robert Heller                        ||InterNet:   [EMAIL PROTECTED]
http://vis-www.cs.umass.edu/~heller  ||            [EMAIL PROTECTED]
http://www.deepsoft.com              /\FidoNet:    1:321/153






     
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to