更新时间:2023-11-13 16:56:16
使用MinGW生成的静态库存档通常与Visual C ++编译器/链接器兼容.因此,通过将.a
文件添加到Visual Studio项目属性中的链接器输入中,您应该能够直接使用它们:
The archives of static libraries generated with MinGW are generally compatible with Visual C++ compiler/linker. So, you should be able to use them directly by adding .a
files to linker input in your project properties in Visual Studio:
Properties
(Alt-F7).Configuration Properties->Linker->Input
.a
存档的列表libgcc.a
库Properties
(Alt-F7).Configuration Properties->Linker->Input
.a
archives you need to uselibgcc.a
library此外,关于混合C运行时库properties of C/C++->Code Generation->Runtime Library
可能会发生问题,但这取决于与MinGW一起使用的构建配置.有时有必要从MinGW链接到libmsvcrt.a
,但在很多(如果不是大多数情况下)会导致问题.
Also, there may occur problems regarding mixed C run-time libraries properties of C/C++->Code Generation->Runtime Library
, but this depends on your build configuration you use with MinGW. Sometimes it is necessary to link against libmsvcrt.a
from MinGW but in many (if not most) cases it causes problems.
最后,这种混合的MinGW和Visual C ++链接通常适用于C模块,但据我所知,它不适用于C ++.
Finally, this mixed MinGW and Visual C++ linking generally works but for C modules and it does not work for C++, as far as I know.