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

[HELP] /usr/bin/ld: cannot find -lgtk-4 #1814

Closed
DarkCat09 opened this issue Jul 30, 2024 · 1 comment
Closed

[HELP] /usr/bin/ld: cannot find -lgtk-4 #1814

DarkCat09 opened this issue Jul 30, 2024 · 1 comment

Comments

@DarkCat09
Copy link

Newly created project does not compile on Void Linux musl x86_64. Development files for all required libraries are installed via sudo xbps-install base-devel gtk4{,-devel}, headers in /usr/include exist.

...
  = note: /usr/bin/ld: cannot find -lgtk-4: No such file or directory
          /usr/bin/ld: cannot find -lpangocairo-1.0: No such file or directory
          /usr/bin/ld: cannot find -lpango-1.0: No such file or directory
          /usr/bin/ld: cannot find -lharfbuzz: No such file or directory
          /usr/bin/ld: cannot find -lgdk_pixbuf-2.0: No such file or directory
          /usr/bin/ld: cannot find -lcairo-gobject: No such file or directory
          /usr/bin/ld: cannot find -lcairo: No such file or directory
          /usr/bin/ld: cannot find -lvulkan: No such file or directory
          /usr/bin/ld: cannot find -lgraphene-1.0: No such file or directory
          /usr/bin/ld: cannot find -lgtk-4: No such file or directory
          /usr/bin/ld: cannot find -lpangocairo-1.0: No such file or directory
          /usr/bin/ld: cannot find -lpango-1.0: No such file or directory
          /usr/bin/ld: cannot find -lharfbuzz: No such file or directory
          /usr/bin/ld: cannot find -lgdk_pixbuf-2.0: No such file or directory
          /usr/bin/ld: cannot find -lcairo-gobject: No such file or directory
          /usr/bin/ld: cannot find -lcairo: No such file or directory
          /usr/bin/ld: cannot find -lvulkan: No such file or directory
          /usr/bin/ld: cannot find -lgraphene-1.0: No such file or directory
          /usr/bin/ld: cannot find -lgraphene-1.0: No such file or directory
          /usr/bin/ld: cannot find -lgtk-4: No such file or directory
          /usr/bin/ld: cannot find -lpangocairo-1.0: No such file or directory
          /usr/bin/ld: cannot find -lpango-1.0: No such file or directory
          /usr/bin/ld: cannot find -lharfbuzz: No such file or directory
          /usr/bin/ld: cannot find -lgdk_pixbuf-2.0: No such file or directory
          /usr/bin/ld: cannot find -lcairo-gobject: No such file or directory
          /usr/bin/ld: cannot find -lcairo: No such file or directory
          /usr/bin/ld: cannot find -lvulkan: No such file or directory
          /usr/bin/ld: cannot find -lgraphene-1.0: No such file or directory
          /usr/bin/ld: cannot find -lpango-1.0: No such file or directory
          /usr/bin/ld: cannot find -lharfbuzz: No such file or directory
          /usr/bin/ld: cannot find -lgdk_pixbuf-2.0: No such file or directory
          /usr/bin/ld: cannot find -lcairo-gobject: No such file or directory
          /usr/bin/ld: cannot find -lcairo: No such file or directory
          collect2: error: ld returned 1 exit status
          

error: could not compile `gtk-test` (bin "gtk-test") due to 1 previous error
@DarkCat09
Copy link
Author

Solved. Linker was searching for .a libs (because static linking is default for musl), but GTK libs are provided only as shared (.so).

$ RUSTFLAGS="-C target-feature=-crt-static" cargo run

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

1 participant