tags:

views:

67

answers:

1

The command g++ -o myprogram myprogram.c -std=c++0x works well on ubuntu but when I try the same with centos it throws me an error cc1plus: error: unrecognized command line option "-std=c++0x". Even google doesn't give the answer. Have anybody experienced it before? Does anybody know the solution?

+3  A: 

You most likely have different versions of the compiler on each system, run g++ --version to see which version you're running on each (-std=c++0x is only supported from version 4.4 of g++).

Motti
How to update g++ to version 4.4 in centos?
Sunil
@Sunil, sorry I haven't the foggiest clue.
Motti
You can always download the TAR file and build it yourself: http://gcc.gnu.org/install/
Employed Russian