2017-05-07 53 views
0

我真的嘗試了很多。鏘不附帶標準C++包括,顯然無法找到他們:是否有可能在Windows上使用Clang編譯C++?

clang++ file.cpp -o file.out 
C:\Folder\file.cpp:1:11: fatal error: 'iostream' file not found 
#include <iostream> 
     ^
1 error generated. 

傳遞MinGW的包括由參數,返回另一個錯誤:

clang++ -target x86_64-w64-mingw32 C:\Folder\file.cpp -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++ -IC:\MinGW\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\x86_64-w64-mingw32 -IC:\MinGW\mingw64\x86_64-w64-mingw32\include -o C:\Folder\file.out -std=c++11 
clang++.exe: error: unable to execute command: program not executable 
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) 

當我使用-c它不使用鏈接器也不會生成可執行文件。

編輯:我在Windows

+0

你是從什麼執行的,你確定它可以使用DOS風格的路徑嗎? – Quentin

+0

我使用哪些? –

+0

按照指南在windows上安裝clang –

回答

0

運行運行從「64本機工具命令提示符下VS 2017年」,或類似的東西你的命令。它會爲你設置一些必要的環境變量。

相關問題