Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add std=c++11 flag to clang-cl?

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.

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

like image 305
usr1234567 Avatar asked Nov 27 '25 22:11

usr1234567


1 Answers

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

clang defaults to C++11 for Windows targets.

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

like image 83
Min Avatar answered Nov 29 '25 11:11

Min



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!