Re: MinGW libraries
On Oct 9, 3:00 am, "BobR" <removeBadB...@worldnet.att.net> wrote:
John wrote in message...
I am using Eclipse C++ on Windows with MinGW for linkage. Can you tell
me why the libraries used by MinGW (in the \MinGW\lib directory) have
a .a extension, wich is unix library extension? I thought that MinGW
would use .lib libraries.
Thank you.
Could it be because a static library is a collection of object files,
It's more than that.
sometimes called an "Archive"?
And an archive can have other types of files in it.
The ".lib" extension is, AFAIK, a ms thing.
I think it's pretty universal. I've seen it on a lot of
systems. Unix doesn't use it, simply because Unix doesn't have
real library files; in the older versions of Unix, a "library"
was an archive with a special first entry, created by ranlib.
(I'm not sure that the traditional differences are very
important today, but back when machines where a lot slower,
having a random index could make linking a lot faster.)
I have changed the '.lib' extension to '.a' on a few
third-party libraries, and it worked fine with GCC(MinGW).
I'm pretty sure that g++ under Windows can understand .lib
files, as well as Unix-like .a files. (For that matter, the
files generated by CygWin's ar look very much like the files
generated by Microsoft's lib.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34