Re:LLVM and Clang 3.2 released
by simfoo on Friday December 21, 2012 @11:33AM
(#4953330)
It would be a tremendous gain for the project if someone zipped up an all-in-one, ready to use package for Windows consisting of Clang and working standard libraries for C and C++. It doesnt (yet) need to be the new libc++ STL, a copy of the GCC libstdc++ libs would be enough.
[ Parent
| on HN ]
It appears someone has done some work on it. See http://sourceforge.net/projects/mingw-w64/files/Toolchains%2...
I gave it a very quick look however got missing DLL messages (pthreadGC2) when trying to compile. I don't have the time to look into it today, hopefully over the Christmas break I will be able to get it working. If I do I will look at how sensible it is to maintain a similar Windows build. A standard Windows build available as an archive or an installer would be great.
EDIT: The error messages look like they may be related to Cygwin although I could be totally wrong on that, it is just the readme mentions Cygwin but nothing else :)
The solution is to install a very specific build of MinGW. See http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056..., where the recommended MinGW installation is "mingw-get-inst-20120426.exe". Then you must remove any other C compilers from your path and include this MinGW and llvm. On my Windows 7 x64 system I have three versions of Visual Studio and 2 other installations of MinGW, so I was careful to remove them all from my path. I created a pathclang.bat containing the following
set PATH=C:\Windows\system32;c:\MinGW32\bin;c:\llvm\bin
set CPATH=C:\MinGW32\include
and got clang 3.2 to work in 32-bit mode: pathclang.bat
clang -m32 -o hello.exe hello.c
hello.exe
Alas, it appears that 64-bit mode is currently unsupported on Windows.