Bug report #5859

./qgis: error while loading shared libraries: libqgis_core.so.1.9.0

Added by pvanbosgeo - over 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Build/Install
Affected QGIS version:master Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:15324

Description

I have compiled QGIS from source (master, version b6bf12a..90b02ec). Yet, I cannot open QGIS, I am getting the error message: ./qgis: error while loading shared libraries: libqgis_core.so.1.9.0: cannot open shared object file: No such file or directory. The libqgis_core.so.1.9.0 is however in the lib directory /usr/local/qgis1-9/lib.

History

#1 Updated by Tim Sutton over 10 years ago

Try

export LD_LIBRARY_PATH=/usr/local/qgis1-9/lib
/usr/local/qgis1-9/bin/qgis

You can make a small bash script to launch it with the above commands it that works for you.

#2 Updated by pvanbosgeo - over 10 years ago

Good temporary solution, thanks

#3 Updated by Tim Sutton over 10 years ago

  • Status changed from Open to Closed

#4 Updated by pvanbosgeo - over 10 years ago

Although the provided solution works, it is a temporary solution i.m.h.o. Also note that in earlier version (both 1.8 and 1.9.90) I do not have the same problems after compiling / installing.

I wouldn't therefore consider this bug closed?

#5 Updated by pvanbosgeo - over 10 years ago

Writing a config file with the path to /usr/local/qgis1-9/lib in /etc/ld.so.conf.d also works:

cd
echo "/usr/local/qgis1-9/lib" > qgis1-9.conf
sudo mv qgis1-9.conf /etc/ld.so.conf.d
cd /etc/ld.so.conf.d
sudo ldconfig

I am still wondering why there was not need to do this before, with other versions. Is this specific to my system?

#6 Updated by Jaka Kranjc over 10 years ago

It's not. The install strips the runtime path (rpath) from the binary, so it expects the library to be in the standard search paths.

#7 Updated by Vaclav Petras about 10 years ago

As stated above LD_LIBRARY_PATH fixes the problem. But since this is not considered as a bug, the solution should be stated somewhere in compile instructions (http://www.qgis.org/api/INSTALL.html and Building_QGIS_with_CMake). Some other solution is mentioned in Building_QGIS_from_Source but this not the solution which most developers want, I think.

The connection to CMAKE_SKIP_RPATH (e.g. #5620) is not clear to me but probably it should be explained.

And now just repeating the solution:

MY_QGIS_PATH=/usr/local/qgis1-9
export LD_LIBRARY_PATH=$MY_QGIS_PATH/lib/
$MY_QGIS_PATH/bin/qgis

#8 Updated by Giovanni Manghi about 10 years ago

Vaclav Petras wrote:

As stated above LD_LIBRARY_PATH fixes the problem. But since this is not considered as a bug, the solution should be stated somewhere in compile instructions (http://www.qgis.org/api/INSTALL.html and Building_QGIS_with_CMake). Some other solution is mentioned in Building_QGIS_from_Source but this not the solution which most developers want, I think.

The connection to CMAKE_SKIP_RPATH (e.g. #5620) is not clear to me but probably it should be explained.

And now just repeating the solution:
[...]

maybe it would be worth propose a patch for the documentation?

#9 Updated by zirneklitis - almost 10 years ago

Too early to be closed.

I have just compiled fresh QGIS master version (1.9.0-Master / 2c59866) on my Fedora 14x64. The LD_LIBRARY_PATH bug is still there. I have put a shell script inside the /etc/profile.d/ with the following line: "LD_LIBRARY_PATH=/usr/local/lib". All the programs (except the new QGIS) accept this configuration.

Now the funny part:

$ qgis
qgis: error while loading shared libraries: libqgis_core.so.1.9.0: cannot open shared object file: No such file or directory
$ echo $LD_LIBRARY_PATH
/usr/local/lib
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
$ qgis

Now it works!

Any explanations?

#10 Updated by Jürgen Fischer almost 10 years ago

zirneklitis - wrote:

Any explanations?

you didn't export LD_LIBRARY_PATH, so subprocesses - like qgis - don't see it.

Also available in: Atom PDF