2017-05-07 54 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年”,或类似的东西你的命令。它会为你设置一些必要的环境变量。

相关问题