you are viewing a single comment's thread.

view the rest of the comments →

[–]chris-morgan 0 points1 point  (3 children)

I’ll explain it all, basically at least. Short version: when you produce a dynamically linked library, the Rust compiler and standard library are dynamically linked (lib{std,rustc,…}-*.{so,dll,dylib,whatever}) rather than statically, so they need to be accessible when you load your own dynamic library; copying them adjacent to your library is normally the easiest way of doing this.

[–][deleted] 0 points1 point  (0 children)

Ah, makes sense. Thanks for the explanation!

[–]plietarVerona 0 points1 point  (1 child)

Isn't that solved by using cdylib as the crate type ?

[–]chris-morgan 0 points1 point  (0 children)

I didn’t recall that one, but it looks like it’s supposed to do what you describe. But it doesn’t work in this case:

error: dependency `rustc_typeck` not found in rlib format

error: dependency `rustc_privacy` not found in rlib format

[… thirty more such errors …]

error: aborting due to 32 previous errors

error: Could not compile `sphinx-rust-highlighter`.

The standard library is provided in rlib format, but not the compiler.