Connecting Tech Pros Worldwide Forums | Help | Site Map

MinGW libraries

John
Guest
 
Posts: n/a
#1: Oct 6 '07
Hi,

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.


red floyd
Guest
 
Posts: n/a
#2: Oct 6 '07

re: MinGW libraries


John wrote:
Quote:
Hi,
>
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.
>
No, but you could probably find out in either gnu.g++.help or an Eclipse
newsgroup or mailing list.

What was your C++ language question?
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
 
Posts: n/a
#3: Oct 6 '07

re: MinGW libraries


On 2007-10-06 18:08, John wrote:
Quote:
Hi,
>
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.
Because MinGW is trying hard to be UNIX running on tom of windows. For
further questions about MinGW please use a MinGW group/mailing list.

--
Erik Wikström
BobR
Guest
 
Posts: n/a
#4: Oct 9 '07

re: MinGW libraries



John wrote in message...
Quote:
Hi,
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,
sometimes called an "Archive"? The ".lib" extension is, AFAIK, a ms thing. I
have changed the '.lib' extension to '.a' on a few third-party libraries,
and it worked fine with GCC(MinGW).

--
Bob R
POVrookie


BobR
Guest
 
Posts: n/a
#5: Oct 9 '07

re: MinGW libraries



John wrote in message...
Quote:
Hi,
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,
sometimes called an "Archive"? The ".lib" extension is, AFAIK, a ms thing. I
have changed the '.lib' extension to '.a' on a few third-party libraries,
and it worked fine with GCC(MinGW).

--
Bob R
POVrookie


James Kanze
Guest
 
Posts: n/a
#6: Oct 9 '07

re: MinGW libraries


On Oct 9, 3:00 am, "BobR" <removeBadB...@worldnet.att.netwrote:
Quote:
John wrote in message...
Quote:
Quote:
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.
Quote:
Could it be because a static library is a collection of object files,
It's more than that.
Quote:
sometimes called an "Archive"?
And an archive can have other types of files in it.
Quote:
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.)
Quote:
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ée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

James Kanze
Guest
 
Posts: n/a
#7: Oct 10 '07

re: MinGW libraries


Alf P. Steinbach wrote:
Quote:
* James Kanze:
Quote:
Quote:
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.)
Quote:
AFAIK they're COFF format all, so to a limited extent yes.
The object files are COFF. I don't think COFF or ELF say
anything about the format of a library file. But Microsoft
seems to have adopted something very much like the Unix format.
Quote:
However there's name mangling and calling conventions and and
and.
Quote:
So the compatibility is more of a theoretical issue, really.
Not necessarily. The C-API is well defined, and you might want
to link against third party libraries using it.

--
James Kanze (GABI Software) mailto:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Closed Thread