[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using the static library after building the shared library...

From: Bob Friesenhahn
Subject: Re: using the static library after building the shared library...
Date: Sat, 29 Jul 2006 10:48:17 -0500 (CDT)

On Sat, 29 Jul 2006, Ed Hartnett wrote:

Are other compilers the same in these respects? Do they generally use
the shared library by default, and require some flags to use the
static one?

Yes, this is the normal behavior for all modern systems I am aware of.

The immediate result is that if I have the build and install shared
libraries, I am going to break everyone's makefiles on that
machine. :-(

It's a shame that gcc didn't take the other approach, of using static
libraries unless told to use the shared ones. That way, users could
install the shared libraries on their machine and start to use them,
without breaking all existing builds on that machine.

It is actually the behavior of the linker rather than GCC. The reason why OS vendors chose this behavior is that less disk space is consumed, library code may be shared by many applications in RAM, host/kernal variances may be handled via libraries, and it is easy to update the library without breaking dependent applications. You will find that for many modern OSs, it is impossible to build a completely static application except for very simple cases like the 'cat' and 'sh' programs.

Bob Friesenhahn
GraphicsMagick Maintainer,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]