如何在Windows上从命令行运行clang?

问题描述:

在上周Going Native会议上,Chandler Carruth宣布存在用于在Windows上运行cl的预构建二进制文件。相同的信息位于博客文章此处

At the Going Native conference last week, Chandler Carruth announced the existence of prebuilt binaries for running clang on windows. The same information is in a blog post here. The intended audience for this is users of Visual Studio, but I want to run clang from the command line.

我运行安装程序并添加了LLVM bin 目录到我的路径,但是当我尝试编译Hello world时,我得到:

I ran the installer and added the LLVM bin directory to my path, but when I try to compile "Hello world", I get this:

C:\>clang hello.cpp
hello.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^
1 error generated.

我找不到任何有关如何配置在Windows上运行clang的信息, m猜测,在我弄清楚如何告诉ang在哪里搜索标准库头文件,我必须告诉它在哪里寻找库链接。

I can't find any information on how to configure things to run clang on Windows, and I'm guessing that after I figure out how to tell clang where to search for standard library headers, I'll have to tell it where to look for libraries to link with. Can somebody walk me through the setup step by step or point me to such a walkthrough?

Clang在Windows上是一个工作,进步和Chandler Carruth在他的Going Native 2013讲话中说,iostreams是目前不工作的事情之一。

Clang on Windows is a work in progress and Chandler Carruth said in his Going Native 2013 talk that iostreams was one of the things that do not currently work.