tags:

views:

43

answers:

2

Hi,

I'm wondering can I use static libraries (lib*.a files) compiled with one version of MingW and use them on the other version ? Or do I have to recompile all libraries ?

A: 

Yes you can. You don't need to recompile them if they are not giving any problems

Himanshu
But I libraries compiled on some os can't be used on other ?
Seba
.a files are simply archives of .o files ? Or is it more complicated ?
Seba
@Seba : True for first one. Libraries compiled on some OS can't be used on other one. You need to recompile them. For second one, .a files are archives of .o files which are compiled as statis libraries.
Himanshu
Thank you :) Will linker link full .o file containing required code or just the portion that is needed ?
Seba
@Seba. The linker will link the full .o file since it is a statically linked library.
Himanshu
+3  A: 
  • Static libraries (*.a files) are just archives of object files (*.o files)
  • You can mix together pieces of code compiled against different versions of a library (here, the MinGW library) as long as they maintain binary code compatibility. In the case of MinGW, this means all 3.* versions play nice together.
FX
Thanks for your help :)
Seba
Do You know maybe, whats the difference between .a files and .lib files (microsoft) ? are .lib files also some sort of archives of .o files ?
Seba