Compiling a Geant4 based software, but get an error in root

Hi Root community,

Can you give me a hint about this compiling problem of a software that uses root and it’s Geant4 based, here I get a root compiling problem with make only. However it’s compiled fine in the first attempt, but I did a lot and forgot what I did wrong to get this error message. notice that I am using a binary distro but my ubuntu version is 21, that why you see the cling message.

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
x86_64-linux-gnu-g+±9 -O3 -DNDEBUG -xc++ -E -v /dev/null 2>&1 | sed -n -e ‘/^.include/,${’ -e ‘/^ /.*++/p’ -e ‘}’
Results was:
With exit code 0
Warning in cling::IncrementalParser::CheckABICompatibility():
Possible C++ standard library mismatch, compiled with GLIBCXX ‘20200408’
Extraction of runtime standard library version was: ‘20210923’
In file included from input_line_11:3:
In file included from /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/TClonesArray.h:27:
In file included from /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/TObjArray.h:25:
In file included from /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/TSeqCollection.h:25:
In file included from /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/TCollection.h:29:
In file included from /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/TString.h:28:
In file included from /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/ROOT/RStringView.hxx:26:
In file included from /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/ROOT/RWrap_libcpp_string_view.h:545:
/home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/ROOT/libcpp_string_view.h:275:63: error: no member named ‘numeric_limits’ in namespace ‘std’
size_type max_size() const _NOEXCEPT { return (_VSTD::numeric_li…
~~~~~~~^
/home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/ROOT/libcpp_string_view.h:275:78: error: unexpected type name ‘size_type’: expected expression
…max_size() const _NOEXCEPT { return (_VSTD::numeric_limits<size_type>::m…
^
/home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/include/ROOT/libcpp_string_view.h:275:19: error: no return statement in constexpr function
size_type max_size() const _NOEXCEPT { return (_VSTD::numeric_li…
^
Error: /home/aelabass/Documents/root_v6.20.06.Linux-ubuntu20-x86_64-gcc9.3/root/bin/rootcling: compilation failure (/home/aelabass/Documents/HyperK/WCSim-build/mydev/libWCSimRootDict0f6572b63a_dictUmbrella.h)
make[2]: *** [CMakeFiles/WCSimRoot.dir/build.make:94: WCSimRootDict.cxx] Error 1
make[1]: *** [CMakeFiles/Makefile2:126: CMakeFiles/WCSimRoot.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

_ROOT Version:6.20.06
_Platform: ubuntu21.10
_Compiler:gcc11.2.0


It seems to me that your ROOT binary distribution (uses gcc 9) is incompatible with your operating system (uses gcc 11).

There’s what @Wile_E_Coyote said, and there might be a mismatch in C++ standard versions used to compile these ROOT headers. IIRC in ROOT 6.22 we give a more helpful message for this case, and this isn’t an issue anymore in 6.24.

Hi Axel, sorry for late reply. I figured it out, by installing and configuring the appropriate gcc and g++ versions.

No problem, thanks for letting us know!