Problem compiling scripts root v5.10/5.12

Hi!

I have recently upgraded to root v5.12, and (almost) everything works fine. However, when I try to run compiled scripts I get an error “cant find libCore.so” (see below). The library DOES exist in /usr/local/lib/root/lib, and as can be seen below, this path is included in the compilation command, so it should really find this library. I have also tried to add this path to ld_library_path, but it didnt work either. The funny thing is, it do find the library if I run the script in interpreted mode. Do somebody know the solution to this? I’ve included the output of the compilation/execution of the script below and also the makefile.

Im running SL4.1, root v5.12 (but the same thing happens on v5.10)

thanks
Petter

[hofverberg@proton dbinterface]$ make QLOOK
g++ -c QLOOK.cpp -I/usr/local/include/root -I/usr/include/mysql
g++ -o QLOOK QLOOK.o -L/usr/local/lib/root -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm -ldl -rdynamic
[hofverberg@proton dbinterface]$ ./QLOOK
./QLOOK: error while loading shared libraries: libCore.so: cannot open shared object file: No such file or directory

PROG1=QLOOK
SRC1=${PROG1}.cpp
OBJ1=${PROG1}.o

CC=g++

QLOOK: ${OBJ1}
${CC} -o ${PROG1} ${OBJ1} -L/usr/local/lib/root -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm -ldl -rdynamic

${OBJ1}: ${SRC1}
${CC} -c ${SRC1} -I/usr/local/include/root -I/usr/include/mysql

.PHONY: clean
clean:
rm -f *.o

Hi Petter,

[quote=“phermi”]The library DOES exist in /usr/local/lib/root/lib [hofverberg@proton dbinterface]$ make QLOOK g++ -c QLOOK.cpp -I/usr/local/include/root -I/usr/include/mysql g++ -o QLOOK QLOOK.o -L/usr/local/lib/root -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm -ldl -rdynamic[/quote]
If it is in /usr/local/lib/root/lib, you should also specify -L/usr/local/lib/root/lib. But I believe it’s in /usr/local/lib/root, so then that’s fine.

Try to add it to LD_LIBRARY_PATH (all caps). E.g. by calling LD_LIBRARY_PATH=/usr/local/lib/root/lib:$LD_LIBRARY_PATH ./QLOOK

Cheers, Axel.

yes, sorry, offcourse its in /usr/local/lib/root, just a typo.

capital letters were used in the library path

Im using the exact same scripts as before the root-upgrade, I just changed the Makefile, so its really odd it doesnt work. Anybody have other ideas what it might be?

cheers
PEtter