I install root(5.34/04) on i686 machine and under ubuntu 12.10. However, when I try to compile the codes I have successfully run on another computer, there are bunch of errors as follows(part of the errors),
regenerate.o: In function main': regenerate.cpp:(.text+0x742): undefined reference to
TMath::Nint(double)'
regenerate.cpp:(.text+0x944): undefined reference to TVector3::TVector3(double, double, double)' regenerate.cpp:(.text+0x972): undefined reference to
TVector3::TVector3(double, double, double)'
regenerate.cpp:(.text+0x9a0): undefined reference to TVector3::TVector3(double, double, double)' regenerate.cpp:(.text+0x9c2): undefined reference to
operator-(TVector3 const&, TVector3 const&)'
regenerate.cpp:(.text+0x9eb): undefined reference to TVector3::~TVector3()' regenerate.cpp:(.text+0xa03): undefined reference to
TVector3::Unit() constâ
regenerate.cpp:(.text+0xa2c): undefined reference to TVector3::~TVector3()' regenerate.cpp:(.text+0xa69): undefined reference to
TVector3::Unit() constâ
regenerate.cpp:(.text+0xa92): undefined reference to TVector3::~TVector3()' regenerate.cpp:(.text+0xaaa): undefined reference to
operator*(TVector3 const&, TVector3 const&)'
regenerate.cpp:(.text+0xac8): undefined reference to operator*(TVector3 const&, TVector3 const&)' regenerate.cpp:(.text+0xae6): undefined reference to
operator*(TVector3 const&, TVector3 const&)'
regenerate.cpp:(.text+0xcb1): undefined reference to TRandom::Uniform(double, double)' regenerate.cpp:(.text+0xd1f): undefined reference to
TVector3::TVector3(double, double, double)'
regenerate.cpp:(.text+0xd39): undefined reference to TVector3::RotateY(double)' regenerate.cpp:(.text+0xd4f): undefined reference to
TVector3::operator()(int)'
regenerate.cpp:(.text+0xd6d): undefined reference to TVector3::operator()(int)' regenerate.cpp:(.text+0xd8b): undefined reference to
TVector3::operator()(int)â
regenerate.cpp:(.text+0xdc1): undefined reference to TVector3::operator()(int)' regenerate.cpp:(.text+0xddf): undefined reference to
TVector3::operator()(int)â
The compile codes I use is:
g++ -c regenerate.cpp root-config --cflags
g++ root-config --glibs
-o regenerate regenerate.o
And the results of âroot-config --cflags --glibsâ is
-pthread -m32 -I/usr/local/include/root -L/usr/local/lib/root -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic
Thanks very much.