简体   繁体   English

GCC / MingW在不同版本上编译

[英]GCC/MingW compiling on different versions

I'm wondering can I use static libraries (lib*.a files) compiled with one version of MingW and use them on the other version ? 我想知道我可以使用通过MingW一个版本编译的静态库(lib * .a文件),而在另一版本上使用它们吗? Or do I have to recompile all libraries ? 还是我必须重新编译所有库?

  • Static libraries ( *.a files) are just archives of object files ( *.o files) 静态库( *.a文件)只是目标文件( *.o文件)的存档
  • 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. 您可以将针对库的不同版本(此处为MinGW库)编译的代码片段混合在一起,只要它们保持二进制代码兼容性即可。 In the case of MinGW, this means all 3.* versions play nice together. 就MinGW而言,这意味着所有3. *版本都可以很好地配合使用。

Yes you can. 是的你可以。 You don't need to recompile them if they are not giving any problems 如果它们没有出现任何问题,则无需重新编译它们

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM