Clang on Windows

If you build Clang with MSVS, it will automatically search the default VS include paths, and pull in those headers. This is the reason the libstdc++ headers are producing errors: they are importing C functions not present in the VS headers. Using Clang for C++ with VS is for now a no-go: you will get link failures due to missing ABI (name mangling and others) functionality in Clang. If you still want to use the MSVS Clang, don't point it to MinGW headers. It will parse the VS headers (including C++), it just will fail to link.


EDIT: I have built a dw2 version of GCC (32-bit only) accompanied by Clang. Exceptions work in this build, and so you can build real C++ stuff with Clang now on Windows. Get version 3.2 here.


The obvious answer is you forgot sending -fno-ms-compatibility to clang++ :P

  1. You are right.
  2. VC++ is GUI tool-chain, MinGW is character console.
  3. No as clang is mature enough for public consumption but still to stabilize so let its dev team work on the code otherwise you risk work that might become lost island. I'm using -I as your example suggests.

I'm doing windows app dev using VS and use clang+CodeBlocks for sharing aspects neutral to platform's domain.