Dear all,
I am trying to compile a program which uses some ROOT libraries. Here is the Makefile
ROOTLIBS:= $(shell root-config --libs)
name=mca2
all: mca2
clean:
rm *.o mac2
$(name).o: $(name).cpp
g++ -O2 -pipe -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread \
-I $(ROOTSYS)/include -o $(name).o -c $(name).cpp
mca2: $(name).o
g++ -O2 $(name).o $(ROOTLIBS) -o mca2
and he is the error I got after make
make
g++ -O2 -pipe -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread \
-I /Applications/root/include -o mca2.o -c mca2.cpp
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
In file included from /Applications/root/include/TNamed.h:26:
In file included from /Applications/root/include/TObject.h:31:
In file included from /Applications/root/include/Rtypes.h:37:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/atomic:543:2: error: <atomic> is not implemented
#error <atomic> is not implemented
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
In file included from /Applications/root/include/TNamed.h:26:
In file included from /Applications/root/include/TObject.h:31:
/Applications/root/include/Rtypes.h:226:14: error: no type named 'atomic' in namespace 'std'
typedef std::atomic<TClass*> atomic_TClass_ptr;
~~~~~^
/Applications/root/include/Rtypes.h:226:20: error: expected unqualified-id
typedef std::atomic<TClass*> atomic_TClass_ptr;
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
In file included from /Applications/root/include/TNamed.h:26:
In file included from /Applications/root/include/TObject.h:34:
/Applications/root/include/TStorage.h:82:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TStorage,0) //Storage manager class
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
In file included from /Applications/root/include/TNamed.h:26:
/Applications/root/include/TObject.h:214:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TObject,1) //Basic ROOT object
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
In file included from /Applications/root/include/TNamed.h:26:
In file included from /Applications/root/include/TObject.h:232:
/Applications/root/include/TBuffer.h:325:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TBuffer,0) //Buffer base class used for serializing objects
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
In file included from /Applications/root/include/TNamed.h:29:
In file included from /Applications/root/include/TString.h:41:
/Applications/root/include/RStringView.h:32:30: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
In file included from /Applications/root/include/TNamed.h:29:
/Applications/root/include/TString.h:263:20: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
TString(TString &&s); // Move constructor
^
/Applications/root/include/TString.h:444:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TString,2) //Basic string class
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:25:
/Applications/root/include/TNamed.h:62:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TNamed,1) //The basis for a named object (name, title)
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:28:
/Applications/root/include/TAttAxis.h:77:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TAttAxis,4); //Axis attributes
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:31:
In file included from /Applications/root/include/TArrayD.h:25:
/Applications/root/include/TArray.h:60:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TArray,1) //Abstract array base class
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
In file included from /Applications/root/include/TAxis.h:31:
/Applications/root/include/TArrayD.h:57:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TArrayD,1) //Array of doubles
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:25:
/Applications/root/include/TAxis.h:167:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TAxis,9) //Axis class
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:29:
/Applications/root/include/TAttLine.h:59:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TAttLine,2); //Line attributes
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:33:
/Applications/root/include/TAttFill.h:54:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TAttFill,2) //Fill area attributes
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:37:
/Applications/root/include/TAttMarker.h:56:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TAttMarker,2); //Marker attributes
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:41:
/Applications/root/include/TArrayC.h:56:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TArrayC,1) //Array of chars
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:44:
/Applications/root/include/TArrayS.h:57:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TArrayS,1) //Array of shorts
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:47:
/Applications/root/include/TArrayI.h:57:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TArrayI,1) //Array of ints
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
In file included from mca2.cpp:4:
In file included from /Applications/root/include/TH1D.h:25:
In file included from /Applications/root/include/TH1.h:50:
/Applications/root/include/TArrayF.h:57:4: error: unknown type name 'atomic_TClass_ptr'
ClassDef(TArrayF,1) //Array of floats
^
/Applications/root/include/Rtypes.h:248:4: note: expanded from macro 'ClassDef'
_ClassDef_(name,id,virtual,) \
^
/Applications/root/include/Rtypes.h:233:11: note: expanded from macro '_ClassDef_'
static atomic_TClass_ptr fgIsA; \
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [mca2.o] Error 1
I am using the last ROOT version released and I set correctly the environment variable ROOTSYS, maybe am I missing something?