How to specify c++0x flag on cent os
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"
. Eve开发者_运维技巧n google doesn't give the answer. Have anybody experienced it before? Does anybody know the solution?
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++).
In the CentOS repositories is something called g++44
. Yum it, or grab it however makes the most sense to you.
Then, when you build, use g++44...
with the rest of your switches. That might help, you never know.
If it works for you then you could remove g++
and symlink g++44
.
精彩评论