I've installed Rust compiler via brew install rust
and I have the following Hello World program:
fn main() {
println!("Hello World!");
}
I've compiled it via: rustc -Cprefer-dynamic hello.rs
for a smaller size.
However I've got the following error when executing it:
$ ./hello
dyld: Library not loaded: @rpath/libstd-99517fd8418575af.dylib
Referenced from: mydir/./hello
Reason: image not found
Abort trap: 6
Here is the output from otool
:
$ otool -L hello
hello:
@rpath/libstd-99517fd8418575af.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
What I am missing?