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

Re: How to compile with .so libraries instead of .a ones?



On Sat, Jan 17, 2004 at 11:50:21PM -0600, Ramasubramanian Ramesh wrote:
> Hi,
> 
>  I always thought that the libxx.a libraries are needed to compile 
> programs. However it appears that it is
> possible to compile programs without them (I suppose this means .so 
> version will be used). This I gather from the
> response from the debian maintainer of libqt-dev (testing) - libqt-dev  
> only contains libqt.so and other .so files.
> 
>  Can you please let me know what options I am supposed to provide to 
> the compiler for such binary builds?

Usually you include flags of the type:
-lnameoflibrary

for example for libSDL you would use -lSDL,
for libX11 -lX11, etc.

The library's documentation should tell you which flags to use.

For certain libraries you can use the pkg-config script to get
these flags.

For example for linking with gtk you would do:
$ pkg-config gtk --libs
-rdynamic -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm  

pkg-config can also give you the required include flags:
$ pkg-config gtk --cflags
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include  

Bijan
-- 
Bijan Soleymani <bijan@psq.com>
http://www.crasseux.com

Attachment: signature.asc
Description: Digital signature


Reply to: