delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/22/22:25:42

Date: Mon, 22 Dec 1997 22:24:24 -0500 (EST)
Message-Id: <199712230324.WAA22272@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: nur AT vip DOT cybercity DOT dk
CC: djgpp AT delorie DOT com
In-reply-to: <01bd0f4a$480ab620$648b08c3@nielsrei> (nur@vip.cybercity.dk)
Subject: Re: Why LIB in front of *.a ??

> Why is there a "lib" in front of all DJGPP libraries.

It's a convenience.  If you tell gcc "-lfoo" it looks for the
"standard" foo library, regardless of where it is or what the system
calls it.  DJGPP would call it libfoo.a and expect to find it in the
%DJGPP%/lib directory, but Linux might look in /usr/lib for
libfoo.so.4.1, and a VAX might look in SYS$GNU:[LIBRARIES]FOO.LIB

Windows 95, of course, would look in C:\Windows95\Program Files\Applications\Vendors\FSF\GNU\Compilers\gcc\libraries\standard\system\other\foo\debug.lib ;-)

> I recently installed MGL (Mega Graphics Library) from Scitechsoft and they
> don't produce DJGPP libraries with the LIB in front ?
> 
> Does this means I have to have two copies?

No, it just means that instead of -lfoo you'd type foo.a, as if it
were just another object file.

> Can I tell DJGPP to search for libraries that do NOT have the "lib" in
> front?

Yes, but it won't "search" for them (I think).  You'd have to supply
the path yourself, just as if it were an object file (*.o).  You can
even mix them.  For example:

	gcc -o hello.exe hello.o ../mystuff/somelib.a -lalleg

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019