[cfe-dev] How can clang (built with Visual Studio) work with MinGW gcc-toolchain?

Fangqing Du via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 1 16:52:50 PST 2018


It works!
Thank you NAKAMURA!

Fangqing

2018-02-01 16:18 GMT-08:00 NAKAMURA Takumi <geek4civic at gmail.com>:

> Have you tried
> -target x86_64-w64-mingw32
> ?
>
> 2018年2月2日(金) 7:27 Fangqing Du via cfe-dev <cfe-dev at lists.llvm.org>:
>
>> Hi cfe-dev,
>>
>> I downloaded the pre-built clang from llvm official download page. And
>> find that it's built with Visual Studio.
>> But locally I haven't install Visual Studio yet.
>> My question is: How can clang work with my local pre-installed MInGW
>> gcc-toolchain?
>>
>> For eg:
>> If the design files include <cstdio> or something like header files, it
>> will error out with following error message:
>> C:\>"C:\Program Files\LLVM\bin\clang++.exe" main.cpp
>> main.cpp:1:10: fatal error: 'cstdio' file not found
>> #include <cstdio>
>>          ^
>> 1 error generated.
>>
>>
>> So is there any option, like '-gcc-toolchain' option on Linux platform to
>> specify a header file path, to let the clang (build with Visual Studio) to
>> find the header files AUTOMATICALLY, not though '-I' option?
>>
>> I tried '-gcc-toolchain' on Windows platform, it cannot work, and put
>> following warning message:
>> C:\>"C:\Program Files\LLVM\bin\clang++.exe" main.cpp dut.cpp
>> -gcc-toolchain "C:\\mingw64"
>> clang++.exe: warning: argument unused during compilation:
>> '--gcc-toolchain=C:\\msys64\\mingw64'
>>
>> Thanks a lot!
>> Fangqing
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180201/a388968c/attachment.html>


More information about the cfe-dev mailing list