简体   繁体   English

lib-mingw 和 lib-vc2019 有什么区别

[英]what is the difference between lib-mingw and lib-vc2019

I'm new to Windows programming and found that lots of prebuilt libraries for Windows offer libraries like lib-mingw, lib-vc2019, lib-vc2017...我是 Windows 编程的新手,发现许多用于 Windows 的预构建库都提供了 lib-mingw、lib-vc2019、lib-vc2017 等库...

Could anyone help to point out谁能帮忙指出

  1. what is the difference?有什么区别? Which library should I use in what case?在什么情况下我应该使用哪个库?
  2. If I want to use Clang on Windows, which one should I use?如果我想在 Windows 上使用 Clang,我应该使用哪一个?
  3. Why these different libraries rarely seen on Linux (let's say Ubuntu), does package managers like apt hide this detail?为什么这些不同的库在 Linux(比如说 Ubuntu)上很少见,package 管理员喜欢隐藏这个细节吗? In other word, why there's no such thing like lib-gcc.a, lib-clang.a on Linux platform?换句话说,为什么Linux平台上没有lib-gcc.a、lib-clang.a这样的东西?
  1. Mingw (GCC), VC2019 and VC2017 are different compilers. Mingw (GCC)、VC2019 和 VC2017 是不同的编译器。 Use the library corresponding to your compiler.使用与您的编译器对应的库。

  2. I'm not sure but I think none of them will work with Clang.我不确定,但我认为它们都不适用于 Clang。 At least on Linux GCC and Clang are very similar.至少在 Linux GCC 和 Clang 上非常相似。 I mean they are mostly binary compatible, many same compiler flags, many same compiler extensions.我的意思是它们大多是二进制兼容的,许多相同的编译器标志,许多相同的编译器扩展。 Clang tried to make it possible to easily replace GCC in your build pipeline. Clang 试图在您的构建管道中轻松替换 GCC。 But all these information is for Linux.但所有这些信息都是针对 Linux 的。

  3. These libraries are not seen on Linux because all these compilers are Windows compilers这些库在 Linux 上看不到,因为所有这些编译器都是 Windows 编译器

You can always build a library with your compiler to use it in your project with your compiler (if you have the sources).您始终可以使用编译器构建一个库,以便在您的编译器项目中使用它(如果您有源代码)。

If it's a third party closed source library and you are a paying customer you can ask if they build it for you.如果它是第三方封闭源代码库并且您是付费客户,您可以询问他们是否为您构建它。 It's usually better the add a new compiler to the build pipeline than to lose a customer.向构建管道添加新编译器通常比失去客户要好。

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

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