Troubles when using Math::Transform3D


ROOT Version: 5.34/36
Platform: slc6
Compiler: g++ (GCC) 4.9.3


In a C++ code using several ROOT functionalities (persistency, histograms, etc ) I’m trying to use the classes
Transform3D, XYZPoint, Rotation3D, etc from the Math library… but my build fails;

I’m using in the code the following includes

#include “Math/Translation3D.h”
#include “Math/RotationX.h”
#include “Math/RotationY.h”
#include “Math/RotationZ.h”
#include “Math/Transform3D.h”
#include “Math/PositionVector3D.h”
#include “Math/Point3Dfwd.h”

They are seen and the compilation goes well, but at the time of building I get errors like

RecoBase/lib/libRecoBase-static.a(PadmeVGeometry.o): In function PadmeVGeometry::Init(PadmeVRecoConfig*, RecoVChannelID*)': /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc49-opt/root/include/Math/GenVector/Transform3D.h:107: undefined reference toROOT::Math::Transform3D::SetIdentity()’
RecoBase/lib/libRecoBase-static.a(PadmeVGeometry.o): In function PadmeVGeometry::InitFromPrimaryNumbers(PadmeVRecoConfig*)': /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc49-opt/root/include/Math/GenVector/Rotation3D.h:123: undefined reference toROOT::Math::gv_detail::convert(ROOT::Math::RotationX const&, ROOT::Math::Rotation3D&)’
RecoBase/lib/libRecoBase-static.a(PadmeVGeometry.o): In function PadmeVGeometry::InitFromPrimaryNumbers(PadmeVRecoConfig*)': /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc49-opt/root/include/Math/GenVector/Transform3D.h:125: undefined reference toROOT::Math::Transform3D::AssignFrom(ROOT::Math::Rotation3D const&, ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D, ROOT::Math::DefaultCoordinateSystemTag> const&)’
/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc49-opt/root/include/Math/GenVector/Transform3D.h:794: undefined reference to ROOT::Math::Rotation3D::operator*(ROOT::Math::RotationY const&) const' /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc49-opt/root/include/Math/GenVector/Transform3D.h:132: undefined reference toROOT::Math::Transform3D::AssignFrom(ROOT::Math::Rotation3D const&, ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D, ROOT::Math::DefaultCoordinateSystemTag> const&)’
/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc49-opt/root/include/Math/GenVector/Transform3D.h:797: undefined reference to ROOT::Math::Rotation3D::operator*(ROOT::Math::RotationZ const&) const' /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/5.34.36/x86_64-slc6-gcc49-opt/root/include/Math/GenVector/Transform3D.h:132: undefined reference toROOT::Math::Transform3D::AssignFrom(ROOT::Math::Rotation3D const&, ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D, ROOT::Math::DefaultCoordinateSystemTag> const&)’

Why is this happening ?
Thanks in advance,
Stefania

Hi,
You need to link withe the libGenVector.so library. Just add in the linker :
root-config --libs -lGenVector

Lorenzo

Hi Lorenzo,

Thank you very much

Stefania

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