Error on B1 compillation

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:_v11.1.3
_Operating System:_linux
Compiler/Version:
CMake Version:

—having this error trying to make example B1 on build.
Running this command
“software/geant4/geant4-v11.1.3/examples/basic/B1/build$ make”
yield this error

collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/exampleB1.dir/build.make:238: exampleB1] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/exampleB1.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

please kindly help on this thanks

Please post the complete error message from the terminal as there should be more information than that (as it stands it’s unclear what the error is).

Please also, as requested in the template, provide the compiler/version and cmake version you are using to assist with that.

user@user-HP-630-Notebook-PC:~/software/geant4/geant4-v11.1.3/examples/basic/B1/build$ make
[ 12%] Linking CXX executable exampleB1
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to HepPolyhedron::operator=(HepPolyhedron&&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTrd1::~HepPolyhedronTrd1()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Text::G4Text(G4String const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to HepPolyhedron::GetNumberOfRotationSteps()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTorus::~HepPolyhedronTorus()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Isotope::~G4Isotope()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4IonisParamMat::GetDensityEffectData()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronEllipticalCone::HepPolyhedronEllipticalCone(double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VGraphicsScene::~G4VGraphicsScene()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::SetReferences()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4analysis.so: undefined reference to G4CsvRFileManager::GetRFile(G4String const&) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::SetForceSolid(bool)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::GetFacet(int, int&, int*, int*, int*) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::SetChemicalFormula(G4String const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4IonisParamElm::G4IonisParamElm(double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::GetMaterialTable()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to vtable for G4VMarker' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4IonisParamElm::~G4IonisParamElm()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedron::AllocateMemory(int, int)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4FR.so: undefined reference to HepPolyhedron::GetNextVertexIndex(int&, int&) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::SetForceCloud(bool)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronBox::~HepPolyhedronBox()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4GMocren.so: undefined reference to vtable for G4Text' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4GMocren.so: undefined reference to G4VMarker::~G4VMarker()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to typeinfo for G4Text' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTrap::HepPolyhedronTrap(double, double, double, double, double, double, double, double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronBox::HepPolyhedronBox(double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::HepPolyhedron(HepPolyhedron const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4IonisParamMat::SetMeanExcitationEnergy(double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VMarker::~G4VMarker()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTetMesh::HepPolyhedronTetMesh(std::vector<CLHEP::Hep3Vector, std::allocator<CLHEP::Hep3Vector> > const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to G4VMarker::G4VMarker(HepGeom::Point3D const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronHype::HepPolyhedronHype(double, double, double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedron::HepPolyhedron(int, int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to typeinfo for G4Material' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::AddRegionStyle(unsigned int, G4String const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTubs::~HepPolyhedronTubs()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronCone::~HepPolyhedronCone()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4Tree.so: undefined reference to HepPolyhedron::Transform(HepGeom::Transform3D const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronEllipsoid::~HepPolyhedronEllipsoid()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4LatticeLogical::LoadMap(int, int, int, G4String)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::G4Material(G4String const&, double, G4Material const*, G4State, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::AddElementByMassFraction(G4Element const*, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronParaboloid::~HepPolyhedronParaboloid()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4Tree.so: undefined reference to G4VisAttributes::operator=(G4VisAttributes const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to operator<<(std::ostream&, G4Isotope const*)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to typeinfo for G4ExtendedMaterial' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VMarker::G4VMarker()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to G4Visible::~G4Visible()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTet::HepPolyhedronTet(double const*, double const*, double const*, double const*)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronEllipticalCone::~HepPolyhedronEllipticalCone()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronHyperbolicMirror::~HepPolyhedronHyperbolicMirror()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPgon::HepPolyhedronPgon(double, double, int, std::vector<CLHEP::Hep2Vector, std::allocator<CLHEP::Hep2Vector> > const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTetMesh::~HepPolyhedronTetMesh()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTube::HepPolyhedronTube(double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::SetLayout(unsigned int, unsigned int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::SetFacet(int, int, int, int, int)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTrap::~HepPolyhedronTrap()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4visHepRep.so: undefined reference to G4Visible::G4Visible(G4VisAttributes const*)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronBoxMesh::~HepPolyhedronBoxMesh()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VGraphicsScene::GetExtent() const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Isotope::GetIsotopeTable()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4visHepRep.so: undefined reference to G4Visible::G4Visible(G4Visible const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4RayTracer.so: undefined reference to G4VisAttributes::G4VisAttributes()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to operator<<(std::ostream&, G4Visible const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4ICRU90StoppingData::Initialise()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4ICRU90StoppingData::G4ICRU90StoppingData()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedronProcessor::HepPolyhedronProcessor()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::SetForceWireframe(bool)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to HepPolyhedron::SetNumberOfRotationSteps(int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronHyperbolicMirror::HepPolyhedronHyperbolicMirror(double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronCone::HepPolyhedronCone(double, double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4LatticePhysical::MapKtoVDir(int, CLHEP::Hep3Vector) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::Clear()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4GMocren.so: undefined reference to HepPolyhedron::GetNextEdge(HepGeom::Point3D<double>&, HepGeom::Point3D<double>&, int&) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Isotope::G4Isotope(G4String const&, int, int, double, int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to G4Visible::G4Visible(G4Visible&&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronHype::~HepPolyhedronHype()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to operator<<(std::ostream&, G4Material const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTrd2::~HepPolyhedronTrd2()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to G4ExtendedMaterial::RetrieveExtension(G4String const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::operator!=(G4VisAttributes const&) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4analysis.so: undefined reference to G4CsvFileManager::G4CsvFileManager(G4AnalysisManagerState const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4LatticePhysical::MapKtoV(int, CLHEP::Hep3Vector) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4FR.so: undefined reference to G4VisExtent::GetExtentRadius() const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4ToolsSG.so: undefined reference to HepPolyhedron::GetNextFacet(int&, HepGeom::Point3D, int, HepGeom::Normal3D) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPgon::HepPolyhedronPgon(double, double, int, int, double const*, double const*, double const*)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTorus::HepPolyhedronTorus(double, double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4GMocren.so: undefined reference to G4Visible::G4Visible(G4Visible const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to typeinfo for G4VMarker’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedronProcessor::execute(HepPolyhedron&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to HepPolyhedron::ResetNumberOfRotationSteps()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::SetForceAuxEdgeVisible(bool)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::AddRegionH2(unsigned int, int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4visHepRep.so: undefined reference to HepPolyhedron::GetNextNormal(HepGeom::Normal3D<double>&) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::SetForceNumberOfCloudPoints(int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4analysis.so: undefined reference to G4CsvRFileManager::G4CsvRFileManager(G4AnalysisManagerState const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::AddElementByNumberOfAtoms(G4Element const
, int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedronProcessor::~HepPolyhedronProcessor()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronCons::~HepPolyhedronCons()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4LatticePhysical::G4LatticePhysical(G4LatticeLogical const*, CLHEP::HepRotation const*)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::G4Material(G4String const&, double, int, G4State, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::createPolyhedron(int, int, double const (*) [3], int const (*) [4])' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisExtent::GetNullExtent()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPara::~HepPolyhedronPara()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to operator<<(std::ostream&, G4Material const*)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4LatticeLogical::G4LatticeLogical()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4GMocren.so: undefined reference to vtable for G4Square’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronParaboloid::HepPolyhedronParaboloid(double, double, double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronSphere::HepPolyhedronSphere(double, double, double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to G4VisAttributes::G4VisAttributes(G4Colour const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTubs::HepPolyhedronTubs(double, double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VVisManager::SetConcreteInstance(G4VVisManager*)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to typeinfo for G4Visible’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::Reset()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronCons::HepPolyhedronCons(double, double, double, double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to operator<<(std::ostream&, G4Text const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4LatticePhysical::RotateToGlobal(CLHEP::Hep3Vector const&) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VGraphicsScene::G4VGraphicsScene()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VVisManager::~G4VVisManager()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4IonisParamMat::GetDensityCorrection(double) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4RayTracer.so: undefined reference to G4VVisManager::GetConcreteInstance()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::G4Plotter(G4Plotter const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPgon::~HepPolyhedronPgon()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::G4Plotter()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to G4Visible::SetVisAttributes(G4VisAttributes const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronSphere::~HepPolyhedronSphere()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::IsForcedAuxEdgeVisible() const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to operator<<(std::ostream&, HepPolyhedron const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::SetForceLineSegmentsPerCircle(int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VMarker::SetSize(G4VMarker::SizeType, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4FR.so: undefined reference to G4VisExtent::GetExtentCentre() const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4FR.so: undefined reference to G4VisAttributes::GetForcedDrawingStyle() const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4visHepRep.so: undefined reference to HepPolyhedron::GetNextVertex(HepGeom::Point3D&, int&) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4IonisParamMat::FindMeanExcitationEnergy(G4Material const*) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4Material::GetMaterial(G4String const&, bool)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTube::~HepPolyhedronTube()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::G4VisAttributes(bool)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronEllipsoid::HepPolyhedronEllipsoid(double, double, double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4IonStoppingData::G4IonStoppingData(G4String const&, bool)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::GetNumberOfMaterials()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedron::fNumberOfRotationSteps’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4Tree.so: undefined reference to G4Visible::operator=(G4Visible const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4Material::GetZ() const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::AddRegionParameter(unsigned int, G4String const&, G4String const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4LatticeLogical::Load_NMap(int, int, int, G4String)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::HepPolyhedron(HepPolyhedron&&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::ClearRegion(unsigned int)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedronProcessor::push_back(HepPolyhedronProcessor::Operation, HepPolyhedron const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4FR.so: undefined reference to HepPolyhedron::GetVertex(int) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPara::HepPolyhedronPara(double, double, double, double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VVisManager::G4VVisManager()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Visible::operator=(G4Visible&&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to operator<<(std::ostream&, G4Text::Layout)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4analysis.so: undefined reference to G4CsvNtupleFileManager::G4CsvNtupleFileManager(G4AnalysisManagerState const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisExtent::operator!=(G4VisExtent const&) const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to G4VMarker::G4VMarker()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4GMocren.so: undefined reference to G4Square::~G4Square()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4analysis.so: undefined reference to vtable for G4CsvNtupleFileManager' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::AddStyle(G4String const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to operator<<(std::ostream&, G4VisAttributes const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTrd1::HepPolyhedronTrd1(double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPcon::HepPolyhedronPcon(double, double, std::vector<CLHEP::Hep2Vector, std::allocator<CLHEP::Hep2Vector> > const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to G4Visible::G4Visible()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to G4Text::G4Text(G4String const&, HepGeom::Point3D<double> const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisAttributes::CreateAttValues() const’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPcon::HepPolyhedronPcon(double, double, int, double const*, double const*, double const*)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTet::~HepPolyhedronTet()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::InvertFacets()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisExtent::G4VisExtent(double, double, double, double, double, double)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4Plotter::AddRegionH1(unsigned int, int)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronBoxMesh::HepPolyhedronBoxMesh(double, double, double, std::vector<CLHEP::Hep3Vector, std::allocatorCLHEP::Hep3Vector > const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VMarker::operator!=(G4VMarker const&) const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4geometry.so: undefined reference to HepPolyhedron::SetVertex(int, HepGeom::Point3D const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4GMocren.so: undefined reference to G4Text::~G4Text()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to typeinfo for G4VVisManager’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisExtent::Transform(HepGeom::Transform3D const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronPcon::~HepPolyhedronPcon()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4processes.so: undefined reference to G4Material::GetA() const' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to typeinfo for G4VGraphicsScene’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTrd2::HepPolyhedronTrd2(double, double, double, double, double)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4visHepRep.so: undefined reference to G4Visible::~G4Visible()’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to G4VisExtent::~G4VisExtent()' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to operator<<(std::ostream&, G4VMarker const&)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4Material::ComputeDensityEffectOnFly(bool)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4OpenGL.so: undefined reference to G4Visible::SetVisAttributes(G4VisAttributes const*)’
/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4vis_management.so: undefined reference to operator<<(std::ostream&, G4VisExtent const&)' /usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4materials.so: undefined reference to G4ICRU90StoppingData::~G4ICRU90StoppingData()’
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/exampleB1.dir/build.make:238: exampleB1] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/exampleB1.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

_Geant4 Version:_v11.1.3
_Operating System:_Ubuntu 22.04
*Compiler/Version:*11.4.0
CMake Version:_3.22.1

Thanks for the info! I’m not exactly sure what’s happening/happened, but something looks very wrong with the install of Geant4, in particular (but not limited to):

/usr/bin/ld: /home/user/software/geant4/geant4-v11.1.3-install/lib/libG4graphics_reps.so: undefined reference to HepPolyhedronTrd1::~HepPolyhedronTrd1()’

Since HepPolyhedronTrd1 is part of that library, that would suggest a corrupt/bad install. All I can suggest is to delete and reinstall Geant4 itself. If the problem then persists, we’ll need to know the CMake command/arguments used, and any warnings/errors printed during the install.

user@user-HP-630-Notebook-PC:~/software/geant4/geant4-v11.1.3/build$ make install
[ 0%] Built target ptl-shared
[ 2%] Built target G4clhep
Consolidate compiler generated dependencies of target G4global
[ 4%] Built target G4global
[ 5%] Built target G4intercoms
[ 5%] Built target G4zlib
[ 7%] Built target G4analysis
[ 8%] Built target G4graphics_reps
[ 9%] Built target G4materials
[ 17%] Built target G4geometry
[ 23%] Built target G4particles
[ 24%] Built target G4track
[ 27%] Built target G4digits_hits
[ 82%] Built target G4processes
[ 82%] Built target G4tracking
[ 83%] Built target G4event
[ 84%] Built target G4run
[ 85%] Built target G4error_propagation
Consolidate compiler generated dependencies of target G4interfaces
[ 85%] Built target G4interfaces
[ 85%] Built target G4parmodels
[ 88%] Built target G4persistency
[ 94%] Built target G4physicslists
[ 94%] Built target G4readout
[ 96%] Built target G4modeling
[ 97%] Built target G4vis_management
[ 97%] Built target G4FR
[ 98%] Built target G4visHepRep
[100%] Built target G4RayTracer
[100%] Built target G4Tree
[100%] Built target G4VRML
[100%] Built target G4GMocren
Consolidate compiler generated dependencies of target G4ToolsSG
[100%] Built target G4ToolsSG
Install the project…
– Install configuration: “Release”
– Installing: /usr/local/lib/libG4clhep.so
CMake Error at source/externals/clhep/cmake_install.cmake:52 (file):
file INSTALL cannot copy file
“/home/user/software/geant4/geant4-v11.1.3/build/BuildProducts/lib/libG4clhep.so”
to “/usr/local/lib/libG4clhep.so”: Permission denied.
Call Stack (most recent call first):
source/externals/cmake_install.cmake:47 (include)
source/cmake_install.cmake:67 (include)
cmake_install.cmake:47 (include)

O.k, assuming you intended to install in /home/user/software/geant4/geant4-v11.1.3-install/lib as before, you’ll need to run

cmake -DCMAKE_INSTALL_PREFIX=/home/user/software/geant4/geant4-v11.1.3-install .

in the build directory, then rerun make install.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.