Installation issue

Dear experts

I’m not sure this is an issue of ROOT or Garfield++, when I tried to install Garfield++ on server I got those errors:

[ 98%] Building CXX object Tests/CMakeFiles/RandomNumberGenerators.dir/RandomNumberGenerators.cpp.o
In file included from /group/had/muon/ssun/ICEDUST_master/ICEDUST_externals_install/root_v6.24.02/include/TString.h:29,
                 from /group/had/muon/ssun/ICEDUST_master/ICEDUST_externals_install/root_v6.24.02/include/TNamed.h:26,
                 from /group/had/muon/ssun/ICEDUST_master/ICEDUST_externals_install/root_v6.24.02/include/TRandom.h:25,
                 from /group/had/muon/ssun/ICEDUST_master/ICEDUST_externals_install/root_v6.24.02/include/TRandom3.h:25,
                 from /group/had/muon/ssun/garfieldpp/Include/Garfield/RandomEngineRoot.hh:4,
                 from /group/had/muon/ssun/garfieldpp/Tests/RandomNumberGenerators.cpp:3:
/group/had/muon/ssun/ICEDUST_master/ICEDUST_externals_install/root_v6.24.02/include/ROOT/RStringView.hxx:32:10: error: conflicting declaration of template ‘template<class _CharT, class _Traits> using basic_string_view = std::experimental::__ROOT::basic_string_view<_CharT, _Traits>’
   32 |    using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;
      |          ^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
                 from /usr/include/c++/11/string:55,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/ostream:38,
                 from /usr/include/c++/11/iostream:39,
                 from /group/had/muon/ssun/garfieldpp/Tests/RandomNumberGenerators.cpp:1:
/usr/include/c++/11/string_view:98:11: note: previous declaration ‘template<class _CharT, class _Traits> class std::basic_string_view’
   98 |     class basic_string_view
      |           ^~~~~~~~~~~~~~~~~

That’s not the only error (so many errors), I’m using ROOT v6.24.02, g++ v11.4.1, and the newest Garfield++ from GitLab. Any suggestions?

Maybe it’s more related to Garfield++ since I already have ROOT 6.24.02 installed on the server.

maybe @hschindl can give some hints

Dear @Crisps

On my macOS (11.7.10) I have ROOT 6.24/06 and g++ 13.0.0. When checking out today the latest version of garfield++, I had no problems with the compilation.
Kind regards
Piet

This looks like a C++ standard mismatch. Is it possible that the ROOT installation you are using was built using a different compiler/C++ standard than the compiler you are using for building Garfield++?

You are right, after I set c++ standard to the same as ROOT it worked.