Rust project using dylibs and prefer-dynamic flag #461
Unanswered
MaximKolesnik
asked this question in
Q&A
Replies: 1 comment
-
This is more of a rustc/cargo question, but yeah, you need to tell the dynamic linker where to search for shared libraries - either via LD_LIBRARY_PATH or via rpath. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my project there several crates that are built as dylib and I use prefer-dynamic flag to dynamically link libstd and etc. But when debugger fails to start since it cannot local neither my so files and runtime libs. The only way how I can make it work is to set env variable:
"env": { "LD_LIBRARY_PATH": "/home/lagobas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/:""${workspaceFolder}/.build/source/debug/" }
Is that how it is supposed to work? And if it is, is there a better way of providing path to the correct toolchain?
Beta Was this translation helpful? Give feedback.
All reactions