Wednesday, May 9, 2007

Debugging an install

I was trying to install a program and couldn't work out what was going wrong. It looked like it compiled okay but when I tried to run it the linked shared objects weren't there.

./exa_c: error while loading shared libraries: cannot open shared object file: No such file or directory

So, in order to find out what was happening I had to run the following to check out the compiled program.
ldd exa_c => not found => /lib64/ (0x00002ba378eeb000) => /lib64/ (0x00002ba379141000)
/lib64/ (0x00002ba378ccd000)

This tells me that although the program compiled okay there the first library isn't found in the LD_LIBRARY_PATH. Now I had set this variable in my own bash profile, but not in apache's. So when I ran this program in a server through cgi the fucking thing didn't work. Adding the right environment to /etc/profile enabled everyone access to the correct path for the library. Success.

1 comment:

WW said...

Hey thanks, I was having trouble with this too and found the solution here.