using libloading on os x, I have stumbled upon an issue with what I assume to be dynamic library dependencies not getting found.
I have been playing with an example, which, when compiled and run, crashes with this:
It would seem that the issue is an inability to find this
For reference, using
otool -L on the dynamic lib yields this:
libmy_plugin.dylib: /Users/jgerber/src/rust/pes-dylib/target/debug/deps/libmy_plugin.dylib (compatibility version 0.0.0, current version 0.0.0) @rpath/libstd-abe443acf5b6ec18.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1) /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
Interestingly, the example that i am playing with works fine if you run the executable via
cargo run. I assume that cargo run adds some additional contextual info that the loader uses...