I have recently installed Ubuntu 20.04 on my Windows Computer and now want to install C++ 11 compiler on it. I have installed the g++ compiler but now am not able to install or upgrade it ti c++11 compiler. Can someone please tell how to do it?
Asked
Active
Viewed 7,198 times
1
-
See https://stackoverflow.com/questions/16886591/how-do-i-enable-c11-in-gcc – Seva Alekseyev Sep 15 '20 at 14:48
-
So just by making that file will do the work I have to include it somewhere also. – logan007 Sep 15 '20 at 15:26
-
`g++` supports several C++ standards. You just need to tell it which one you want using the `-std` flag. – Nikos C. Sep 15 '20 at 15:42
-
Every C++ compiler available on Ubuntu 20 is a C++11 compiler. At least. Both GCC and Clang support C++17 at this point. – Zan Lynx Sep 15 '20 at 15:44
1 Answers
2
When you compile use -std=c++11
flag:
g++ -std=c++11 main.cpp
UPD
As per comment below:
-std=c++17 -pedantic

Alex
- 9,891
- 11
- 53
- 87