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

Re: GTK static libs



On Wed, 02 Feb 2000 11:26:21 -0800, Shead, Tim wrote:
>> Not that I'm aware of. Probably the elegant option doesn't exist because 
>> a) dynamic linking is the Right Thing [tm], and b) static linking is
> *very* 
>> OS/compiler dependent (-static won't work on SGI IRIX, for example). 
> 
> Dynamic linking with libmydynamiclib.so:
> 
> gcc -o foo foo.o -lmydynamiclib
> 
> Static linking with libmystaticlib.a:
> 
> gcc -o foo foo.o libmystaticlib.a

Yes, this works, but ...

> In other words, treat the library as if it were another object file, which
> is what it really is, anyway (you have to know the path, of course).

.. the location of the path is the difficult part. For example: on SGI
IRIX 6.x, the library could live in /lib, /lib32, or /lib64 (or /usr/lib,
/usr/lib32, /usr/lib64) depending on the memory/API model the compiler on
the particular machine wishes to choose as its default. The linker knows
about the default, and chooses the correct directories (and libraries)
accordingly.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/





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