如何添加std = c ++ 11标志到clang-cl? [英] How to add std=c++11 flag to clang-cl?

查看:208
本文介绍了如何添加std = c ++ 11标志到clang-cl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows下用clang-cl编译一个C ++ 11程序。 Clang-cl是clang的包装器,与cl(Visual Studio编译器)更兼容。我试图添加 -std = c + + 11 / std = c ++ 11 这是没有意外,因为cl没有C ++ 11标志。
但是我不能使用clang-cl的C ++ 11功能。

I tried to compile a C++11 program with clang-cl under Windows. Clang-cl is the wrapper around clang to be more compatible with cl (Visual Studio compiler). I tried to add -std=c++11 and /std=c++11 and both get rejected. This is to no surprise as cl has no C++11 flag. But I can not use C++11 features with clang-cl.

如何在clang-cl中启用C ++ 11支持? p>

How can I enable C++11 support in clang-cl?

推荐答案

在前面提到的文档中: http://clang.llvm.org/docs/UsersManual.html#clang-cl

In the documentation mentioned before says: http://clang.llvm.org/docs/UsersManual.html#clang-cl


clang默认为Windows目标的C ++ 11.

clang defaults to C++11 for Windows targets.

也许你不需要将任何标志传递给clang-cl。

Maybe you don't need to pass any flag to clang-cl.

这篇关于如何添加std = c ++ 11标志到clang-cl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆