How to build Clang in Visual Studio?


I followed “Using Visual Studio” section in totally, and still got many error and cannot generate clang.exe in the build output. (LLVM tools are generated without any problem). Many errors say that some .inc file could not be included to the source of Clang tool. I almost downloaded the latest Clang and there is no change. Is there any other steps I missed to build Clang? I am using Visual Studio 2010.

What version of Visual Studio 2010 are you using (Express, etc)?

Did you run cmake -G "Visual Studio 10" again after fetching LLVM and
clang both?


Make sure you chekout clang in llvm\tools\clang

I am using Visual Studio 2010 ultimate (the full version). I run cmake after I put clang folder under LLVM\tools, and the VS solution file was generated successfully with many Clang projects in it. So I think the downloaded Clang is taking effect.

Could you give us the first couple of lines of your output so we can see the errors that you get?

Make sure that both llvm and clang are up to date. (svn update). They
are different repositories and if you svn update llvm you must also to
svn update clang.

Thanks for your advice. You are right. The build succeeded after I updated both LLVM and Clang to the latest through SVN. I think the previous downloaded source package of Clang is not the latest and it blocked the build.