環境:windows7,64位
1、下載並安裝llvm,安裝包里除了llvm,也有clang:
http://releases.llvm.org/5.0.0/LLVM-5.0.0-win64.exe
2、下載並安裝mingw:
https://sourceforge.net/projects/mingw-w64/
安裝時選擇CPU架構為 x86_64
把安裝路徑添加到path中:
C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev2\mingw64\bin
3、打開命令行窗口,開始編譯程序:
clang --target=x86_64-pc-mingw64 hello.c -o hello.exe