I'm trying to compile a C++ project under different Linux OS's. Under Fedora 27 all compiles great. Under CentOS 6 it fails with
error: ‘nullptr’ was not declared in this scope
which I read means the wrong compiler is being used. But, my qmake file contains:
CONFIG += C++14
QMAKE_CXXFLAGS += -no-pie
QMAKE_LFLAGS += -no-pie
On Fedora 27 the resultant Makefile contains:
CXXFLAGS = -pipe -Wall -g -W -D_REENTRANT -fPIC $(DEFINES)
On CentOS 6 the resultant Makefile contains:
CXXFLAGS = -pipe -Wall -g -std=gnu++0x -W -D_REENTRANT -fPIC $(DEFINES)
I concluded that the problem is CentOS 6 doesn't support nullptr (c++ 14), and gnu++0x is as recent as is available.
Is it possible to work around this problem? Is there a compatibility include (for 'nullptr', 'override' keywords)?
I don't want to maintain seperate code bases for CentOS6 vs CentOS7.