Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error while loading shared libraries: libsyntax-15ac3cfe29b975a5.so #1962

Closed
Ploppz opened this issue Sep 13, 2017 · 5 comments
Closed

error while loading shared libraries: libsyntax-15ac3cfe29b975a5.so #1962

Ploppz opened this issue Sep 13, 2017 · 5 comments

Comments

@Ploppz
Copy link

Ploppz commented Sep 13, 2017

$ cargo fmt 
error while loading shared libraries: libsyntax-15ac3cfe29b975a5.so: cannot open shared object file: No such file or directory

I have updated to the latest nightly. Suggestion here doesn't work (the first comment). (that is, run export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib before cargo fmt).

$ ls .rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib 
[...]
libsyntax-146db06bb83fc779.so
[...]
@topecongiro
Copy link
Contributor

After you updated your toolchain, you must reinstall rustfmt-nightly via cargo install rustfmt-nightly --force.

@Ploppz
Copy link
Author

Ploppz commented Sep 15, 2017

That fixed it, thank you.

@Ploppz Ploppz closed this as completed Sep 15, 2017
@ctaggart
Copy link
Contributor

I'm working on #2003 and I just installed rustfmt from source with:

cargo install --path .

However, when I run rustfmt I get this error:

$ which rustfmt
/home/cameron/.cargo/bin/rustfmt
$ rustfmt
rustfmt: error while loading shared libraries: libsyntax-64971a96646a2aa2.so: cannot open shared object file: No such file or directory
$ rustup show
Default host: x86_64-unknown-linux-gnu

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.22.0-nightly (0e6f4cf51 2017-09-27)

$ cargo install --list
rustfmt-nightly v0.2.7 (file:///home/cameron/rustfmt):
    cargo-fmt
    rustfmt
    rustfmt-format-diff

@ctaggart
Copy link
Contributor

ctaggart commented Sep 28, 2017

In order to get it to work, I had to do:

export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib

@liuchong
Copy link

liuchong commented Dec 28, 2017

@ctaggart
Thanks!, this "export ..." solved my problem!
But should I have to add to my environment setting? Isn't it should try that path automaticly? 😹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants