I have been tweaking with my system to get the c++ version sorted out, between Geant4 and root. Looks like that is sorted out, but the error messages that I first saw with root are still present: these can be narrowed down to:
home/neera/root/include/Rtypes.h:275:11: error: ‘R__likely’ was not declared in this scope
if (R__likely(recurseBlocker >= 2)) {
/home/neera/root/include/Rtypes.h:281:67: error: expected primary-expression before ‘)’ token
::ROOT::Internal::HasConsistentHashMember(QUOTE(name)) ||
^
/home/neera/root/include/Rtypes.h:281:55: error: ‘QUOTE’ was not declared in this scope
::ROOT::Internal::HasConsistentHashMember(QUOTE(name)) ||
^
/home/neera/root/include/TTree.h:685:33: error: ‘SafeDelete’ was not declared in this scope
void Reset() { SafeDelete(fLeafIter); SafeDelete(fTreeIter); }
^~~~~~~~~~
/home/neera/root/include/TClass.h:391:59: error: ‘TestBit’ was not declared in this scope
Bool_t CanIgnoreTObjectStreamer() { return TestBit(kIgnoreTObjectStreamer);}
/home/neera/root/include/TStorage.h:118:1: error: ‘R__INTENTIONALLY_UNINIT_BEGIN’ was not declared in this scope
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/neera/root/include/TStorage.h:120:1: error: ‘R__INTENTIONALLY_UNINIT_END’ was not declared in this scope
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/neera/root/include/TStorage.h:131:1: error: ‘R__NEVER_INLINE’ does not name a type; did you mean ‘__MATH_INLINE’?
R__NEVER_INLINE void TStorage::UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits) {
^~~~~~~~~~~~~~~
/home/neera/root/include/TObject.h:152:4: error: ‘R__ALWAYS_INLINE’ does not name a type; did you mean ‘__MATH_INLINE’?
/home/neera/root/include/TObject.h:178:42: error: ‘TestBit’ was not declared in this scope
Bool_t IsDestructed() const { return !TestBit(kNotDeleted); }
^~~~~~~
/home/neera/root/include/TObject.h:178:42: note: suggested alternative: ‘TestBits’
Bool_t IsDestructed() const { return !TestBit(kNotDeleted); }
^~~~~~~
TestBits
/home/neera/root/include/TObject.h:302:11: error: ‘IsOnHeap’ was not declared in this scope
if (IsOnHeap()) { // test uses fBits so don’t move next line
^~~~~~~~
/home/neera/root/include/TObject.h:302:11: note: suggested alternative: ‘kIsOnHeap’
if (IsOnHeap()) { // test uses fBits so don’t move next line
^~~~~~~~
kIsOnHeap
Most likely a wrong header file is being inadvertently used. Do (assuming you use make)
make VERBOSE=true |& tee make.01.log
Towards the end it will says that some file name end in .o failed to compiled (because of the error above). Then do:
grep thatfilename.o make.01.log
there will be compile line that we need to tweaks in that line replace the -c with -E and rename the file after the -o to change the extension from .o to .E (and remove any command option starting in -M ). Once you are done, upload the .E file here.
In my Geant4 codes, there is a G4 header RunAction.hh, which calls TFile.h (a root header) on line 39, just as it says in the error log.
Also, in EventAction.cc, like 37 calls RunAction.hh, so the error is in the TFile.h, a root header, which calls other headers. The problem appears to be in:
TObject.h
TStorage.h
Rtypes.h
TString.h
TCollelction.h
TClass.h
TFile.h
TTree.h
I just did a search for 'error" in my file and it showed an error in these header files, specifying exactly what the error is, multiple times. When I get back to work tomorrow, I shall try and debug these files based on the syntaxes i have received in them. But this is something everyone can do as these are all root header files.
But this is something everyone can do as these are all root header files.
They are not the problem. They only fail in your environment because there is (very likely) a stray installation or file that in interfering. The easiest way to figure this out is to just run the C++ macro preprocessor on your file in your environment. For that you need to follow the instruction Wile and I sent exactly and send us the completely result. You can then tell you the command to use (i.e. using the -E to get to the bottom of the problem).
I had to rename the file from.E to .txt as my system will not allow me to upload unknown extensions. it is the same file you asked from taken from the same location that you indicated. Thanks.
You seem to mix Geant4, which uses “-std=c++11” with ROOT, which uses"-std=c++14".
Moreover, it seems that you try to use Geant4 include files from its “/opt/geant4/geant4.10.04.p02/source/” directory. You should use the “include” directory present where Geant4 binaries have been installed (after building).
I believe there is no file with the extension .hxx - that is how it interferes. I need copy and save RConfig.h to RConfig.hxx. then that problem will be gone.
Also “/home/neera/root/include/RConfig.hxx” is not expected.
There should be “/home/neera/root/include/ROOT/RConfig.hxx”.
Can it be that the ROOT binary installation is broken / incomplete?