I have been trying to find a way to get Clang working on Windows but am having trouble. I get Clang to compile successfully, but when I try to compile a program I have a bun
Here is what worked in my environment, on Windows 8.1, overall similar to Seth's instruction, but with fresher tools.
C:/MinGW, to be precise I've used STL's distro.cmake -G "MinGW Makefiles" -D"CMAKE_MAKE_PROGRAM:FILEPATH=C:/MinGW/bin/make.exe" -DCMAKE_BUILD_TYPE=Release ..\llvm (for some reason CMake couldn't find the "make" automatically)#includeint main() { []{ std::cout << "hi"; }(); }
set PATH=/bin;c:/mingw/bin;%PATH% clang++ -std=c++11 1.cpp -o 1.exe -I"C:/MinGW/include" -I"C:/MinGW/include/c++/4.9.1" -I"C:\MinGW\include\c++\4.9.1\x86_64-w64-mingw32" -I"C:\MinGW\x86_64-w64-mingw32\include"
What did not work:
cmake -G "Visual Studio 12" ..\llvm and then compile the solution in Visual Studio. However, that Clang failed to compile a sample cpp, it complained about "undeclared identifier 'char16_t'" and "__int128 is not supported on this target" within the MinGW standard library headers. If I use clang-cl and MS STL headers it complains about "throw x(y)" specifiers . Maybe I needed to provide some extra keys to the build, but I couldn't get it to work.C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase(293,4) : error: cannot compile this throw expression yet _THROW_NCEE(failure, "ios_base::eofbit set"); C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstddef(56,30) : note: expanded from macro '_THROW_NCEE' #define _THROW_NCEE(x, y) throw x(y)