Johannes Peter Assorted Code snippets and Dev devices

Installing clang++ to compile and link on Windows : Part 1

The Problem

In the past I’ve struggled getting clang to work on windows in as complete a capacity as it does on mac or linux.

I tried a few online tutorials and suggested solutions on stack overflow, but all of them had one drawback or another:

  • Some solutions required you to use a separate linking step (since as of the time of this writing clang for windows does not have its own linker)
  • Some solutions required massive -I and -l compiler flags so that all the proper headers and libraries were used.
  • Even when some solutions mostly worked, they often were unable to handle both 32 and 64 bit.
  • Some required you to build clang from source. Not a problem in its own right, but not very convenient, especially when compared to other platforms: apt-get install clang-3.5, brew install llvm --with-clang --with-asan, etc.

So over the last month I tried to come up with a reliable tutorial to get clang to compile and link on windows 8.1 that would avoid these issues.

Continue reading...
comments powered by Disqus