This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: static linking c libraries
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Israel Fdez Cabrera <israel at seg dot inf dot cu>, <gcc-help at gcc dot gnu dot org>
- Date: Wed, 21 May 2003 09:28:02 -0500
- Subject: Re: static linking c libraries
Hi Israel,
Try this, assume you have:
libstdc.a and libstdc.so
libstdc++.a and libstdc++.so
libm.a and libm.so
libfoo.a and libfoo.so
libbar.a and libbar.so
gcc -o myapp \
$(MY_OBJS) \
-Wl,-nostdlib \
-Wl,-Bdynamic -lfoo \
-Wl,-Bstatic -lbar \
-Wl,-Bstatic -lstdc++ \
-Wl,-Bdynamic -lstdc \
-Wl,-Bstatic -lm
I'm just guessing as to the proper order.
--Eljay