Make -jN problem - geometry not matching - ‘ std::vector<G4FieldManager*> >&)’ GetInstance()->erase(i)

I am in the process of building my GEANT4 and I already did the cmake with the options GEANT4_INSTALL_DATA, GEANT4_USE_QT,GEANT4_USE_OPENGL_X11, GEANT4_USE_XM on. Now I did the make -jN and have the following error:

[ 9%] Building CXX object source/geometry/CMakeFiles/G4geometry.dir/magneticfield/src/G4FieldManagerStore.cc.o
/home/ggarcia/path/to/geant4.10.06/source/geometry/magneticfield/src/G4FieldManagerStore.cc: In static member function ‘static void G4FieldManagerStore::DeRegister(G4FieldManager*)’:
/home/ggarcia/path/to/geant4.10.06/source/geometry/magneticfield/src/G4FieldManagerStore.cc:119:31: error: no matching function for call to ‘G4FieldManagerStore::erase(__gnu_cxx::__normal_iterator<G4FieldManager* const*, std::vector<G4FieldManager*> >&)’
GetInstance()->erase(i);
^
/home/ggarcia/path/to/geant4.10.06/source/geometry/magneticfield/src/G4FieldManagerStore.cc:119:31: note: candidates are:
In file included from /usr/include/c++/4.8.2/vector:69:0,
from /home/ggarcia/path/to/geant4.10.06/source/geometry/magneticfield/include/G4FieldManagerStore.hh:45,
from /home/ggarcia/path/to/geant4.10.06/source/geometry/magneticfield/src/G4FieldManagerStore.cc:32:
/usr/include/c++/4.8.2/bits/vector.tcc:134:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = G4FieldManager*; _Alloc = std::allocator<G4FieldManager*>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<G4FieldManager**, std::vector<G4FieldManager*> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = G4FieldManager**]
vector<_Tp, _Alloc>::
^
/usr/include/c++/4.8.2/bits/vector.tcc:134:5: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<G4FieldManager* const*, std::vector<G4FieldManager*> >’ to ‘std::vector<G4FieldManager*>::iterator {aka __gnu_cxx::__normal_iterator<G4FieldManager**, std::vector<G4FieldManager*> >}’
/usr/include/c++/4.8.2/bits/vector.tcc:146:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::iterator) [with _Tp = G4FieldManager*; _Alloc = std::allocator<G4FieldManager*>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<G4FieldManager**, std::vector<G4FieldManager*> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = G4FieldManager**]
vector<_Tp, _Alloc>::
^
/usr/include/c++/4.8.2/bits/vector.tcc:146:5: note: candidate expects 2 arguments, 1 provided
make[2]: *** [source/geometry/CMakeFiles/G4geometry.dir/magneticfield/src/G4FieldManagerStore.cc.o] Error 1
make[1]: *** [source/geometry/CMakeFiles/G4geometry.dir/all] Error 2
make: *** [all] Error 2

I am very newbie with the Linux and also the building process, so any answer should have a lot of explanation so I could understand.

Many thanks for your help.

i think .you must active DGEANT4_USE_GDML=ON then use DGEANT4_USE_QT=ON

You’re are using an old version of the gcc compiler, no longer supported.
Please, see the release notes of Geant4 10.6 for the list of the supported compilers:
http://cern.ch/geant4-data/ReleaseNotes/ReleaseNotes4.10.6.html

Thank you. But it did not work. Do you think, I should start frm the beggining again and then do the cmake of DGEANT4_USE_GDML=ON before te QT cmake?

Dear gcosmo. I’ve checked the GNU gcc compiler required and I saw gcc-4.9.3, mine is gcc (GCC) 7.5.0, and my cmake is cmake version 3.15.2. Do you think it still must be more updated than that? Thnk you for your help.

According to the compilation error posted, the gcc compiler version used (or a component of it) is: 4.8.2. You need to check your system setup and compiler installation.

Thank you. I updated to the latest version of gcc and it worked fine.