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

Install & Play via cargo run fails with cannot find /usr/bin/ld: cannot find -lasound, -lGl, -lX11, -lXi #97

Closed
RyanNerd opened this issue Sep 11, 2021 · 4 comments

Comments

@RyanNerd
Copy link

cargo run

churns for a bit and then fails to compile with this:

note: /usr/bin/ld: cannot find -lasound
          /usr/bin/ld: cannot find -lGL
          /usr/bin/ld: cannot find -lX11
          /usr/bin/ld: cannot find -lXi
          collect2: error: ld returned 1 exit status
@not-fl3
Copy link
Collaborator

not-fl3 commented Sep 11, 2021

Yes, you need to install said libraries.

apt install pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev

(dependning on the disctro the exact command may vary)

@RyanNerd
Copy link
Author

@not-fl3 Figured it out from a StackOverflow answer that clued me in: https://stackoverflow.com/a/17580157/4323201
I needed to create a soft link for each missing libXXXX.so

➜ locate libasound.so
/usr/lib/x86_64-linux-gnu/libasound.so.2
/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0

➜ cd /usr/lib/x86_64-linux-gnu

# create a soft link for each missing libXXX.so:
➜ ln -s libsound.so.2 libsound.so

➜ ll libX11*
lrwxrwxrwx 1 root root   15 May 19 11:07 libX11.so.6 -> libX11.so.6.3.0
-rw-r--r-- 1 root root 1.3M May 19 11:07 libX11.so.6.3.0

➜ ln -s libX11.so.6 libX11.so

@not-fl3
Copy link
Collaborator

not-fl3 commented Sep 11, 2021

It really depends on the distro, but some of them (ubuntu) contains lib*.so only in -dev packages. Usually installing -dev pacakges helps without doing symlinks yourself.

@RyanNerd
Copy link
Author

It really depends on the distro, but some of them (ubuntu) contains lib*.so only in -dev packages. Usually installing -dev pacakges helps without doing symlinks yourself.

I'm running Linux Mint 20.2.
I tried installing the *-dev packages without success. It's up and running now. Thanks for your time and input.

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

2 participants