This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Gcc static linking problems
- From: "Tim Purkerson" <timp at apcon dot com>
- To: "Meng-Hsueh Chiang" <mhchiang at mail dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 13 Aug 2003 08:54:42 -0700
- Subject: RE: Gcc static linking problems
Thanks Meng.
I used ldd on my program. The library libstdc++.so.5 is still listed.
I also added the LD_OPTIONS = -Bstatic. This caused problems with the
library gcc_s. The linker is looking for libgcc_s.a, but not finding it.
Even if I put a -Bdynamic in front of it or list libgcc_s.so.1
explicitly on the compile line it still looks for the static version.
Since Solaris is going away from static linking anyway I am going to
give up on this problem. Thank you for all of your help.
Tim
-----Original Message-----
From: Meng-Hsueh Chiang [mailto:mhchiang@mail.com]
Sent: Wednesday, August 13, 2003 1:28 AM
To: Tim Purkerson
Cc: gcc-help@gcc.gnu.org
Subject: RE: Gcc static linking problems
> Thanks everyone for the help. However, it is still not working
> properly.
>
>
> By changing the order around like Meng and Claudio suggested I was
> able to get the application to compile and link. The problem is that
> it did not link statically.
Can you try
ldd "your program"
to see what libraries are linked. I wondered why it wasn't link
statically if you have -static option. I guess the static link would
require *.a library. This might not be a gcc issue.
>
> Is there something in gcc that could change the link defaults? Or is
> this a Solaris issue?
>
try:
setenv LD_OPTIONS -Bstatic
>
Good luck
-Meng