gtk-rs / gtk3-rs

Rust bindings for GTK 3
https://gtk-rs.org
MIT License
508 stars 90 forks source link

[FEATURE REQUEST] Support for shared libx11 instead of static #764

Closed lattice0 closed 1 year ago

lattice0 commented 1 year ago

After adding gtk3-rs to my project, I get a linking error:

  = note: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libX11.a(Font.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/ld: final link failed: bad value
          collect2: error: ld returned 1 exit status

I think this is probably because I'm building a shared library instead of a binary. Is there a way to make libx11 be linked dynamically? I tried to understand the build.rs system but couldn't find any linkage of x11

sdroege commented 1 year ago

That looks like a setup problem on your system. X11 comes via the gdk pkg-config file, we don't specify any direct linkage.

Running a clean build with ‘cargo build -vvvv‘ should tell you what it pulls from where.