How do I tell gcc to statically link ALL libraries?
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, b-pa...@ti.com
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
> 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.