How can clang (built with Visual Studio) work with MinGW gcc-toolchain?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How can clang (built with Visual Studio) work with MinGW gcc-toolchain?

Hans Wennborg via cfe-dev
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can clang (built with Visual Studio) work with MinGW gcc-toolchain?

Hans Wennborg via cfe-dev

Have you tried
-target x86_64-w64-mingw32
?


2018年2月2日(金) 7:27 Fangqing Du via cfe-dev <[hidden email]>:
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can clang (built with Visual Studio) work with MinGW gcc-toolchain?

Hans Wennborg via cfe-dev
It works!
Thank you NAKAMURA!

Fangqing

2018-02-01 16:18 GMT-08:00 NAKAMURA Takumi <[hidden email]>:

Have you tried
-target x86_64-w64-mingw32
?


2018年2月2日(金) 7:27 Fangqing Du via cfe-dev <[hidden email]>:
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How can clang (built with Visual Studio) work with MinGW gcc-toolchain?

Hans Wennborg via cfe-dev
Hi NAKAMURA,

If my local MinGW is installed at some other places, instead of C driver (default driver), how can clang find it automatically?

Thank you,
Fangqing

2018-02-01 16:52 GMT-08:00 Fangqing Du <[hidden email]>:
It works!
Thank you NAKAMURA!

Fangqing

2018-02-01 16:18 GMT-08:00 NAKAMURA Takumi <[hidden email]>:

Have you tried
-target x86_64-w64-mingw32
?


2018年2月2日(金) 7:27 Fangqing Du via cfe-dev <[hidden email]>:
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev