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

Cannot link statically against alsa library #159

Open
juliohq opened this issue Dec 25, 2023 · 2 comments
Open

Cannot link statically against alsa library #159

juliohq opened this issue Dec 25, 2023 · 2 comments

Comments

@juliohq
Copy link

juliohq commented Dec 25, 2023

I'm getting the following error when trying to link against alsa (statik set to true):

error: could not find native static library `asound`, perhaps an -L flag is missing?

I'm using a patched pkg-config-rs that removes is_static_available (#102) and in theory, just allows you to statically link any system library.

I'm using Arch Linux, so there are no static libraries (*.a files) under /usr/lib (as stated in this forum comment: https://bbs.archlinux.org/viewtopic.php?pid=751287#p751287). Maybe that's the reason why I cannot statically link on Arch?

@sdroege
Copy link
Collaborator

sdroege commented Dec 25, 2023

Well, if you don't have static libraries then you also can't statically link to those non-existing libraries. This seems all working as expected. What behaviour would you expect?

@juliohq
Copy link
Author

juliohq commented Dec 25, 2023

Well, if you don't have static libraries then you also can't statically link to those non-existing libraries. This seems all working as expected. What behaviour would you expect?

I would just like to record this issue (as the repository doesn't have a wiki currently) for Arch Linux users trying to compile libraries statically using pkg-config-rs.

I think the main problem is that doing the same thing in C/C++ (gcc and ld) works as expected, even though technically I don't have the required static libraries, but instead only the headers and source code files.

I'd like to know if someone has figured it out before and record it here too.

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