The 2 ways of building for Windows

本文探讨了使用MinGW编译的LLVM是否可以与Visual Studio编译器及链接器兼容的问题。由于MinGW的g++与Visual Studio的cl使用不同的C++ ABI,直接兼容存在困难。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Q:
>From what I've read, you can build/use LLVM+clang via Visual Studio or via MinGW.  So far, I've only managed
to have my code working via MinGW.

However, most of my users compile using Visual Studio.  Can LLVM that was compiled using MinGW (or using the
pre-built MinGW binary) be linked against using Visual Studio (or, more specifically, using Visual
Studio's "cl" compiler and "link" linker)?

In my first attempt, I get an error message like:

libLLVMX86CodeGen.a(X86TargetMachine.o) : fatal error LNK1143: invalid or corrupt file: no symbol for
COMDAT section 0x6E

________________________________________________________________________________
A:
No. MinGW's g++ and Visual Studio's cl use different C++ ABIs.

转自:http://comments.gmane.org/gmane.comp.compilers.llvm.devel/50191
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值