[cfe-dev] Stop Clang from including problem headers from visual studio 11

Kim Gräsman kim.grasman at gmail.com
Sun May 12 12:48:15 PDT 2013


On Thu, May 9, 2013 at 5:27 PM, Reid Kleckner <rnk at google.com> wrote:
> Whoops, looks like even if you unset %INCLUDE% clang still falls back
> to heuristics to find MSVC's headers.
>
> Looking at the code in clang/lib/Driver/WindowsToolChain.cpp shows you
> can pass -nostdinc to turn this all off.

I've set VCINSTALLDIR to point to my VC10 toolset in my shell's
environment, but it looks like overriding any of the VS*COMNTOOLS env
vars would work too.

E.g.

$ SET VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
$ clang++ ...

Like Reid, I started from here to find my way:
http://clang.llvm.org/doxygen/WindowsToolChain_8cpp_source.html#l00203

- Kim



More information about the cfe-dev mailing list