[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem in statical linking of libraries on linux
From: |
Hans-Bernhard Broeker |
Subject: |
Re: Problem in statical linking of libraries on linux |
Date: |
10 Apr 2001 15:08:22 GMT |
Mukta <address@hidden> wrote:
> I have two libraries of form 'lib*.a', which i have recvd with a package. I
> want to link these libraries with my application in a static mode.
> When i use the -static option with gcc or ld,
There's absolutely no need to use the -static flag just to use some
libs that happen to be available in static form, only. You only need
-static if you want to force the linker to use static libs even though
shared libs of the same name are available, too.
Also note that -static is a position-dependent option, just like -l<name>.
You should switch it off before the end of your gcc command line, by giving
-shared after the list of libs you want linked statically.
> 4. If I keep these libraries in '/usr/lib' and use 'gcc -shared',
> or 'ld -shared', option instead, then this works fine.
Then what's stopping you from doing just that?
--
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.