Re: How to static link a program?

> I tried on one of my projects, and the only static libraries are those
> compiled inside the project.
> It seems that those flags are intended for libraries production. To have
> static linking of the libraries in the executable, you must probably
> list the libraires in the LDFLAGS, i.e. /usr/lib/libglib.a instead of
> -lglib, which will need some editing in

Correct, the configure flags are to determine if you want to make static
and/or dynamic/shared libraries.

If you add -shared or -dynamic, you make gcc/ld have a preferred choice if
it finds both shared and dynamic libraries. -shared is the default.


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