在Clang中激活C ++ 11支持 [英] Activating C++11 support in Clang
问题描述
我已经下载并建立clang版本3.0为了玩弄一些与C ++ 11功能,但是我得到这个错误(即使我 am 使用 -Wc ++ 11-extensions
标志)。
I've downloaded and built clang version 3.0 in order to play around a bit with C++11 features, however I get this error (even though I am using the -Wc++11-extensions
flag).
S:\llvm\code> clang ++ .exe -Wc ++ 11-extensions variadic.cpp
variadic.cpp:4:19:warning:variadic模板是一个C ++ 11扩展[-Wc ++ 11-extensions]
template< typename ... Args>
S:\llvm\code>clang++.exe -Wc++11-extensions variadic.cpp
variadic.cpp:4:19: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template <typename... Args>
我在Windows 7(64位)上使用VS10构建了clang,并且构建成功。
I've built clang with VS10 on Windows 7 (64bit) and the build passed successfully.
编辑:由于@cli_hlt指出这是一个警告,而不是错误,错误是我没有粘贴 无法执行命令:程序无法执行 。根本原因是,link.exe不在PATH中。一旦我从一个VS命令提示符运行一切都很好。
As @cli_hlt pointed out this is a warning not an error, the error is something I did not paste unable to execute command: program not executable. The root cause for that was that link.exe was not in the PATH. Once I ran from a VS command prompt all was well.
推荐答案
你得到一个警告,而不是错误。
You are getting a warning, not an error.
-W开关用于启用编译器警告。所以为了我的理解,通过使用-Wc ++ 11-extensions,你告诉编译器警告你,如果你使用C ++ 11扩展。
The -W switch is used to enable compiler warnings. So for my understanding, by using -Wc++11-extensions you tell the compiler to warn you if you are using C++11 extensions.
发生在这里。
这篇关于在Clang中激活C ++ 11支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!