editorconfig-core-c
editorconfig-core-c copied to clipboard
Program cannot find dynamic library when installing with a non-default prefix
[vagrant@localhost editorconfig-core-c]$ cmake . -DCMAKE_INSTALL_PREFIX=~/apps
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vagrant/src/3party/editorconfig-core-c
[vagrant@localhost editorconfig-core-c]$ cmake --build . --target install
[ 45%] Built target editorconfig_shared
[ 90%] Built target editorconfig_static
[100%] Built target editorconfig_bin
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/vagrant/apps/lib64/libeditorconfig.so.0.12.2
-- Up-to-date: /home/vagrant/apps/lib64/libeditorconfig.so.0
-- Up-to-date: /home/vagrant/apps/lib64/libeditorconfig.so
-- Up-to-date: /home/vagrant/apps/lib64/libeditorconfig_static.a
-- Up-to-date: /home/vagrant/apps/bin/editorconfig-0.12.2
-- Up-to-date: /home/vagrant/apps/bin/editorconfig
-- Up-to-date: /home/vagrant/apps/include/editorconfig/editorconfig.h
-- Up-to-date: /home/vagrant/apps/include/editorconfig/editorconfig_handle.h
[vagrant@localhost editorconfig-core-c]$ /home/vagrant/apps/bin/editorconfig
editorconfig: error while loading shared libraries: libeditorconfig.so.0: cannot open shared object file: No such file or directory
Looks like editorconfig is built with the assumption that the required dynamic libraries will be on the system search path, which may not always be the case. Could you update the linker flags and have it look in a relative rpath, as shown here?
Works for me. There is no need for relocation to support your use case. Absolute RPATHs work fine.