[cfe-dev] get clang to use gcc headers instead of Visual Studio headers

Douglas Gregor dgregor at apple.com
Sat May 22 17:41:03 PDT 2010


On May 22, 2010, at 4:34 PM, Nathan Ridge wrote:

> 
> Hello,
> 
> I would like to try out clang++, to see how suitable of a substitute
> it might be for g++ as a cross-platform C++ compiler. 
> 
> I've built clang on Windows using the instructions provided here for
> Visual Studio: http://clang.llvm.org/get_started.html,
> and now I'm trying to get it to compile a project that was previously
> compiled with MinGW's g++.
> 
> However, I get a bunch of errors, and in the errors I can see that
> clang++ is using the system headers provided by Visual Studio.
> 
> Is there a way to get clang++ to use the MinGW g++ headers instead?

The -nostdinc flag will turn off Clang's default includes; then you can use -I flags to point Clang at the right include paths for MinGW.

	- Doug



More information about the cfe-dev mailing list