2

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?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
kenorb
  • 155,785
  • 88
  • 678
  • 743
  • Basically, if you didn't install runtime library into your system that can't work. Now, how to install this is some thing I don't know. – Stargateur Apr 16 '18 at 13:28

0 Answers0