Re: Feebcp fails to load

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Federico Alves wrote:
> freebcp: error while loading shared libraries: libsybdb.so.5: cannot
> open shared object file: No such file or directory
> 
> The weird thing is that the file exists in /lib. 

Probably the run-time linker is not looking for libsybdb in /lib, but
somewhere else.  The ldd utility will tell you if all libaries are found:

	$ ldd $(which freebcp)
	/usr/local/bin/freebcp:
	         -lpthread.0 => /usr/lib/libpthread.so.0
	         -lsybdb.5 => /usr/local/lib/libsybdb.so.5
	         -lc.12 => /usr/lib/libc.so.12

The freebcp ELF executable can -- depending on how it was compiled --
include a list of directories to search for libraries.  That's the RPATH:

	$ readelf -d  $(which freebcp) | grep RPATH
 	0x0000000f (RPATH) Library rpath: [/usr/pkg/lib:/usr/local/lib]

You can also usually get the runtime linker to report where it's looking. 
"man ld.so" is your friend here.  ISTR you're running Linux; according to
http://linux.die.net/man/8/ld-linux, it will look "[i]n the default path
/lib, and then /usr/lib. If the binary was linked with -z nodeflib linker
option, this step is skipped.".  It understands a long list of environment
variables, including our friend LD_LIBRARY_PATH.  

HTH.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.