0

As the title states, I am having problems compiling my program, and the error is C++11 specific. Is there some way I can go back to the compiler I had on 12.04? Do I need to install another version of g++ and then use that? I googled around but I cannot find what shipped with 12.04. I just need an older alternative to the compiler 14.04 comes with.

Thanks!

user300458
  • 2,138
Mr. Fegur
  • 325

2 Answers2

1

You can install g++ 4.4, 4.6 or 4.7 from the package g++-4.X. (Then compile your program with g++-4.X instead of just g++.)

For reference, the default g++ version in Ubuntu 12.04 is 4.6.

muru
  • 207,228
fkraiem
  • 12,813
0

You can continue using the new g++, and specify the standard to be used:

-std=
   Determine the language standard.   This option is currently only
   supported when compiling C or C++.

For 12.04, man g++ says:

gnu++98
   GNU dialect of -std=c++98.  This is the default for C++ code.

So compile your code with:

g++ --std=gnu++98

However, man g++ on 14.04 says:

gnu++98
gnu++03
   GNU dialect of -std=c++98.  This is the default for C++ code.

So it would look like the default standard hasn't changed.

Are you sure of the source of your error?

muru
  • 207,228