[freetds] Feebcp fails to load

James K. Lowden jklowden at freetds.org
Mon Mar 29 23:41:46 EDT 2010

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)
	         -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.  



More information about the FreeTDS mailing list