Problem:
Version 2 of g ++ is installed on a computer running Ubuntu 12.04. These are versions 4.6 and 5.2.
I need to compile a C ++ 11 program using a Makefile. If I use g ++ as a compiler, it automatically calls version 4.6, it does not support C ++ 11, so compilation does not work. I followed the tutorial online, so now, if I call g ++, it will automatically call version 5.2, and now it works.
I find this solution not very good, since it only works on my PC. Is there a way to recognize in the Makefile if the g ++ version supports C ++ 11 by default and, if not, switch to a newer version?
Thanks!
source
share