This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static link
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: zhao at csksoftware dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 1 Sep 2003 05:10:42 -0500
- Subject: Re: static link
- Organization: Red Hat / Paris
> What I'm trying to do is to link the STL library statically so that I
> don't need to deploy the STL library in the final production
> environment. The flag I'm using is -static-libgcc, but it seems not
> working. After the executable is generated, the libstdc++ is still
> needed in the production environment. Can anybody tell me what I should
> do to deploy my program without the libstdc++ runtime?
If you post more details, I'll try to help you.
What platform are you using? What compiler? What command line? What are
the errors?
You should be able to just use
g++ -static foo.cc
and have it work. Any assistance you could give to improving this:
http://gcc.gnu.org/onlinedocs/libstdc++/install.html#usage
...would be appreciated.
best,
benjamin