Dlopen error

Dear all,

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

would be grateful with any help.

Maena

Hi Maena,

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.

Danilo

Can you post the result of

locate libjpeg.so ldd /home/gate/Progs/root/lib/libASImage.so printenv

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.

Thank u very much for ur response.

I get:

gate@vgate:~/vm_share/DicomAcuros/RootCode$ locate libjpg.so
gate@vgate:~/vm_share/DicomAcuros/RootCode$ ldd /home/gate/Progs/root/lib/libASImage.so
linux-vdso.so.1 => (0x00007fff745e6000)
libGraf.so => /home/gate/Progs/root/lib/libGraf.so (0x00007f53703ba000)
libMathCore.so => /home/gate/Progs/root/lib/libMathCore.so (0x00007f536ff69000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f536fcba000)
libjpeg.so.62 => not found
libtiff.so.3 => not found
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f536fa91000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f536f75c000)
libCore.so => /home/gate/Progs/root/lib/libCore.so (0x00007f536ed68000)
libCint.so => /home/gate/Progs/root/lib/libCint.so (0x00007f536e150000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f536de50000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f536db54000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f536d93d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f536d57d000)
libHist.so => /home/gate/Progs/root/lib/libHist.so (0x00007f536ce28000)
libRIO.so => /home/gate/Progs/root/lib/libRIO.so (0x00007f536c924000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f536c70d000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f536c4ee000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f536c2ea000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5370a7a000)
libMatrix.so => /home/gate/Progs/root/lib/libMatrix.so (0x00007f536be81000)
libThread.so => /home/gate/Progs/root/lib/libThread.so (0x00007f536bc2c000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f536ba29000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f536b822000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f536b605000)
gate@vgate:~/vm_share/DicomAcuros/RootCode$ printenv
G4LEVELGAMMADATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/PhotonEvaporation2.3
MANPATH=/home/gate/Progs/root/man:/usr/local/man:/usr/local/share/man:/usr/share/man
SSH_AGENT_PID=1744
GPG_AGENT_INFO=/tmp/keyring-YL6PCg/gpg:0:1
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=d48165ae36308c130c3dad7500000003-1456153767.81587-1442596221
WINDOWID=69206021
GNOME_KEYRING_CONTROL=/tmp/keyring-YL6PCg
G4NEUTRONXSDATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/G4NEUTRONXS1.2
G4LEDATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/G4EMLOW6.32
USER=gate
LD_LIBRARY_PATH=/home/gate/Progs/Geant4/geant4.9.6.p03-install/lib:/home/gate/Progs/root/lib
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arj=01;31:.taz=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lz=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.axa=00;36:.oga=00;36:.spx=00;36:.xspf=00;36:
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
G4NEUTRONHPDATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/G4NDL4.2
SSH_AUTH_SOCK=/tmp/keyring-YL6PCg/ssh
G4RADIOACTIVEDATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/RadioactiveDecay3.6
LIBPATH=/home/gate/Progs/root/lib
SESSION_MANAGER=local/vgate:@/tmp/.ICE-unix/1660,unix/vgate:/tmp/.ICE-unix/1660
DEFAULTS_PATH=/usr/share/gconf/ubuntu-2d.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu-2d:/etc/xdg
PATH=/home/gate/Progs/Geant4/geant4.9.6.p03-install/bin:/home/gate/Progs/root/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/gate/Documents/gate_doc/ascii/prog/:/home/gate/Progs/Gate/gate_v7.0-install/bin
DESKTOP_SESSION=ubuntu-2d
G4PIIDATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/G4PII1.3
PWD=/home/gate/vm_share/DicomAcuros/RootCode
GNOME_KEYRING_PID=1649
LANG=en_US.UTF-8
MANDATORY_PATH=/usr/share/gconf/ubuntu-2d.mandatory.path
UBUNTU_MENUPROXY=libappmenu.so
G4SAIDXSDATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/G4SAIDDATA1.1
GDMSESSION=ubuntu-2d
ROOTSYS=/home/gate/Progs/root
SHLVL=1
HOME=/home/gate
G4REALSURFACEDATA=/home/gate/Progs/Geant4/geant4.9.6.p03-install/share/Geant4-9.6.3/data/RealSurface1.0
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
DYLD_LIBRARY_PATH=/home/gate/Progs/root/lib
PYTHONPATH=/home/gate/Progs/root/lib
LOGNAME=gate
XDG_DATA_DIRS=/usr/share/ubuntu-2d:/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-QBJ7VODoRU,guid=de61f3f555b275860438b7a700000010
LESSOPEN=| /usr/bin/lesspipe %s
SHLIB_PATH=/home/gate/Progs/root/lib
DISPLAY=:0
XDG_CURRENT_DESKTOP=Unity
LESSCLOSE=/usr/bin/lesspipe %s %s
GATEENV=/home/gate/Progs/Gate
COLORTERM=gnome-terminal
XAUTHORITY=/home/gate/.Xauthority
_=/usr/bin/printenv
OLDPWD=/home/gate

Try now

locate libjpeg.so
locate libtiff.so

There are two options:

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.

1 Like

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?