MinGW libraries

J

John

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.
 
R

red floyd

John said:
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?
 
G

Guest

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.
 
B

BobR

John wrote in message...
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).
 
B

BobR

John wrote in message...
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).
 
J

James Kanze

John wrote in message...
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.)
 
A

Alf P. Steinbach

* James Kanze:
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.)

AFAIK they're COFF format all, so to a limited extent yes.

However there's name mangling and calling conventions and and and.

So the compatibility is more of a theoretical issue, really.


Cheers,

- Alf
 
J

James Kanze

Alf said:
* James Kanze:
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.
However there's name mangling and calling conventions and and
and.
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top