|
Home > Archive > Unix Programming > January 2005 > how to staticalll bin libstdc++*
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to staticalll bin libstdc++*
|
|
| Billy Patton 2005-01-27, 5:52 pm |
| I've got some c++ code that I have written and tested on both a sun solaris8
box and a linux. It works fine. I had a new user try it on thier sun and it
complained about not finding libstdc++??6.so. It has this .so dynamicall
linked to the executable.
How do I tell gcc to statically link ALL libraries?
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, b-patton@ti.com
| |
| David Schwartz 2005-01-28, 2:47 am |
|
"Billy Patton" <bpatton@ti.com> wrote in message
news:Pine.LNX.4.61.0501271435160.18865@holster07.dal.design.ti.com...
> I've got some c++ code that I have written and tested on both a sun
> solaris8 box and a linux. It works fine. I had a new user try it on
> thier sun and it complained about not finding libstdc++??6.so. It has
> this .so dynamicall linked to the executable.
>
> How do I tell gcc to statically link ALL libraries?
You would use '-static'. There are, however, a variety of problems you
could run into this way. What makes you think your library will work on his
machine?
DS
| |
| Paul Pluzhnikov 2005-01-28, 2:47 am |
| Billy Patton <bpatton@ti.com> writes:
> How do I tell gcc to statically link ALL libraries?
Statically linking system libraries (libc.so in particular) is
generally a very bad idea (TM).
This makes your application much larger then it needs to be, and
is quite likely to make your app not work at all on future releases
of the OS.
A much better approach is to link just the libstdc++ statically:
ln -s `g++ --print-file-name=libstdc++.a` .
g++ -o your.exe main.o ... -L. -static-libgcc
rm libstdc++.a
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
|
|
|
|
|