Hello, ROOTers
I have small macro including TVector3.
#include <TROOT.h>
#include <TSystem.h>
#include <TVector.h>
#include <TVector3.h>
void test_load() {
gSystem->Load(“libPhysics”);
TVector3 *v = new TVector3();
v->SetXYZ(1., 2., 3.);
}
I would like to complie this macro by the follwing way,
root [0] .x test_load.cpp++
But, I got some error messages
Info in TUnixSystem::ACLiC: creating shared library ~/harufumi/./test_load_cpp.so
dlopen error: ~/harufumi/./test_load_cpp.so:
undefined symbol: _ZN8TVector3C1Eddd
Load Error: Failed to load Dynamic link library ~/harufuumi/./test_load_cpp.so
/usr/lib/crt1.o: In function _start': /usr/lib/crt1.o(.text+0x18): undefined reference to
main’
~/harufumi/./filegh51mN.o: In function test_load()': ~/harufumi/./filegh51mN.o(.text+0x97): undefined reference to
TVector3::TVector3[in-charge](double, double, double)'
collect2: ld returned 1 exit status
*** Interpreter error recovered ***
If I load libPhysics.so before compiling, it can be compiled
by above method.
root [0] gSystem->Load(“libPhysics.so”);
root [1] .x test_load.cpp++
root [2]
(in this case, commented out gSystem->Load(“libPhysics.so”)
in the macro.
So, Is it impossible to load shared lib in ACLiC mode when
I would like to use TVector3 object ?
In such a case, I can not include
gSystem->Load(“LibPhysics”) in my macro ?
Must I always load lihPhysics.so before compiling ?
I use ROOT v 3.10.02 on linux with gcc 3.2.3 .