[Qt-interest] error while loading shared libraries Mandriva Linux qt 4_5

Konrad Rosenbaum konrad at silmor.de
Thu Mar 19 20:58:38 CET 2009


On Thursday 19 March 2009, Nikos Geronitidis wrote:
> *error while loading shared libraries: libMyLib.so.1: cannot open shared
> object file* : No such file or directory
>
> while this library exists in the same directory the executable exists.
> Any ideas?

Linux is a little different from Windows. ;-)

Unix-like systems (like Linux) handle executables and shared objects (*.so) 
differently.

Executables:
*if you call an executable with path (eg. /bin/echo or ./myprogram) it is 
executed exactly from the directory you give to the system - if it isn't 
there you get an error
*if you call it with no path (eg. echo or myprogram) the system looks for it 
in all directories that are in the $PATH variable (separated with ":") and 
in exactly the order they are in this variable.

Shared Objects:
*The system knows a few directories which are always looked into (/lib 
and /usr/lib)
*The system can configure a few more that are looked into next 
(see /etc/ld.so.conf)
*The user can override it all by setting the $LD_LIBRARY_PATH variable (same 
syntax as PATH) - the system will look there first and then go through its 
configured directories (Warning: the variable name differs on other Unixes)
*The program can also inject directories with the so called "rpath" (which 
is compiled in) - that is the reason why Qt is always found by the 
application although the Qt directory is not configured anywhere (unless 
you use your distributions Qt package)

In short: try to call your program with LD_LIBRARY_PATH=. ./myprogram


	Konrad

-- 
Note: I'm changing my PGP/GPG key soon! New KeyID: 723A6200
Fingerprint: B37C FA75 8C4C 6537 7954  CBC0 CB15 C991 723A 6200
Keyserver: wwwkeys.eu.pgp.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090319/927d8ea2/attachment.bin 


More information about the Qt-interest-old mailing list