Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program cannot find dynamic library when installing with a non-default prefix #34

Open
cmihai opened this issue Feb 12, 2018 · 1 comment

Comments

@cmihai
Copy link

cmihai commented Feb 12, 2018

[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?

@randstr
Copy link
Contributor

randstr commented Oct 5, 2019

Works for me. There is no need for relocation to support your use case. Absolute RPATHs work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants