This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: static linking c libraries
- From: Israel Fdez Cabrera <israel at seg dot inf dot cu>
- To: Eljay Love-Jensen <eljay at adobe dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 22 May 2003 09:14:03 -0400
- Subject: Re: static linking c libraries
- Organization: Segurmatica
- References: <4.3.2.7.2.20030521091902.00b5e600@iplan-mn.corp.adobe.com>
Hi... againg
I'm havin problems yet!
I had /usr/lib/libc.a and /usr/lib/stdlibc++.a I've tried with
-Bstatic -lc -Bstatic -lstdc++
compiling in a RedHat 9, then copy the executable to a RedHat 7.0 but an error
requesting the libstdc++ version 5 appear.
Then I tried with
--static -lc -lstdc++
but nothing diferent happend, any hint?
In the other hand... is there any legal implication for non GPL programs that
links staticaly with C & C++ libs???
best reg@rds
Israel
On Wednesday 21 May 2003 10:28 am, Eljay Love-Jensen wrote:
> 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
--
Israel Fdez Cabrera.
Usuario Linux: 270292 (http://counter.li.org)
israel@seg.inf.cu
Segurmatica.
La Habana, Cuba.