error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-m64" "[REDACTED]/input.rs/target/debug/deps/rustcMzCIhW/symbols.o" "<53 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "[REDACTED]/input.rs/target/debug/deps/{libinput-9f3733a9dad8af94,liblog-d7ffaa050103d639,libbitflags-4cb5efb0e892aac1,libudev-659e820e2061d333,liblibudev_sys-7edc5c8b918313b4,libio_lifetimes-a156ffd2669da5d2,liblibc-337fe196a7e39b09,libinput_sys-43f63f96c531a42e}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-ludev" "-linput" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/[REDACTED]/input.rs/target/debug/deps/rustcMzCIhW/raw-dylibs" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/nix/store/i3p4h70l0qq32lizw0i4px8afn1y7g8w-systemd-minimal-libs-260.1/lib" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "[REDACTED]/input.rs/target/debug/deps/input-225b07b7190d606a" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: rust-lld: error: unable to find library -linput
collect2: error: ld returned 1 exit status
I realize this sounds similar to #59, but I think the problem is slightly different: on NixOS, the reason the library can't be found is that it isn't present by default at all.
In many other C wrapper crates, the error about the missing library (like
libudevandlibxkbcommon) is emitted by pkg-config, which is at least somewhat more legible -- would it be possible to do something similar here as well?Thanks in advance:)
EDIT: as I've since forgotten what the problem was myself, here's some more context:
When libudev is missing, I get the following error -- already on
cargo build:Wall of text
But when libinput is missing, I get this error -- and only during
cargo run(for which I used the example from the README, by copying it tosrc/main.rs)A smaller, but somewhat more confusing, wall of text