Old code for school does not compile with ROOT 6.08/02

I tried to compile old code made for school with a basic Makefile like this

SRCS = $(wildcard *.cpp)
HEADERS = $(wildcard *.h)
OBJECTS = $(SRCS:.cpp=.o)

ROOTLIBS      = $(shell root-config --libs)
ROOTGLIBS     = $(shell root-config --glibs)

all: Pianeti PianetiAnimati

.C.o: $(SRCS) $(HEADERS)
	c++ $(CXXFLAGS) -c -I. $<

Pianeti: $(OBJECTS)
	c++  $(LDFLAGS) -I$(ROOTSYS)/include -I. -o $@ Pianeti.C $(OBJECTS)

PianetiAnimati: $(OBJECTS)
	c++ $(LDFLAGS) -I$(ROOTSYS)/include -I. -o $@ PianetiAnimati.C $(OBJECTS) $(ROOTGLIBS)

	rm -f *.o

but I cannot create “PianetiAnimati” (everything else is OK!).
I’m using ROOT 6.08/02 on Ubuntu LTS 16.04.2 with gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

What can I do?

CorpoCeleste.cpp (918 Bytes)
CorpoCeleste.h (837 Bytes)
SistemaSolare.cpp (414 Bytes)
Pianeti.C (1.6 KB)
vettore.h (777 Bytes)
PianetiAnimati.C (3.9 KB)
Sonda.h (856 Bytes)
vettore.cpp (1.0 KB)
SistemaSolare.h (559 Bytes)
Sonda.cpp (421 Bytes)

What error is reported?

the error seems very “basic”: error: #error “ROOT requires support for C++11 or higher.”

The complete output is in the attached fileerror.txt (94.7 KB)

I’m using the following ROOT version https://root.cern.ch/download/root_v6.08.02.Linux-ubuntu16-x86_64-gcc5.4.tar.gz on Ubuntu 16 gcc5.4


Your code need to be compiled in C++11 mode:

and/or use the result of root-config --cflags

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.