I use root version: 5.34/18 installed under vgate 3.0. I have not defined any environment variables, nothing (As I suppose that the virtual gate machine comes ready for use). I can read some text files and fill matrix with the read values, but when it comes to create a canvas (with the TCanvas function) to plot my data I get problems:
dlopen error: libjpeg.so.62: cannot open shared object file: No such file or directory
Load Error: Failed to load Dynamic link library /home/gate/Progs/root/lib/libASImage.so
Error in TGHScrollBar::TGHScrollBar: arrow_.xpm not found
Error in TGVScrollBar::TGVScrollBar: arrow_.xpm not found
the system cannot find a library, libjpeg.so.62, against which libAsImage.so is linked.
It’s hard to tell what the problem exactly is, likely some misconfiguration, hardly a ROOT issue.
This library is located usually in directories like /usr/lib64/ or /usr/lib/x86_64-linux-gnu/ , but it’s really OS dependent.
If libjpeg.so is found by “locate” but not in the default pahts, you should add it to the LD_LIBRARY_PATH
If not found, then you should install the corresponding package.
a) If the previous locate command does not give any output, you need to install these packages in your system. Check root.cern.ch/build-prerequisites
b) If the previous locate command tells you that they are found, normally in a rare folder, then call LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/the/special/folder before running your program.
I had a similar issue. But I used the following code to compile my code:
void run()
{
gSystem->AddIncludePath( "-I/home/lrdprdx/projects/CAEN/CAENOO/inc" );
gSystem->AddLinkedLibs( "-lCAENDigitizer" );
gSystem->AddLinkedLibs( "/usr/lib/libcaenoo.so" );
//see the next line after this
gSystem->AddLinkedLibs( "/home/lrdprdx/projects/CAEN/CAENOO/src/ROOT/Acquzator_cpp.so" );
gROOT->LoadMacro( "./Acquzator/Test.C++" );
}
I have tested it on my laptop (ROOT 6.16.00) and it works fine. But I’ve also run it on the lab machine (ROOT 5.34) (and of course path is changed). And there I have the following error:
Processing run.cxx…
Info in TUnixSystem::ACLiC: creating shared library
/home/csi/CAEN/NotOfficial/CAENOO/test/DataRead/././Acquzator/Test_C.so
dlopen error: Acquzator_cpp.so: cannot open shared object file: No
such file or directory
Load Error: Failed to load Dynamic link library
/home/csi/CAEN/NotOfficial/CAENOO/test/DataRead/././Acquzator/Test_C.so
/usr/lib/gcc/i486-linux-gnu/4.7/…/…/…/i386-linux-gnu/crt1.o: In
function _start': (.text+0x18): undefined reference to main’
collect2: error: ld returned 1 exit status
The above suggestion about the LD_LIBRARY_PATH env. variable solved the problem. However, I am wondering why on my machine I can “add path” to the .so via gSystem and on the lab machine I can’t?