aweinstock314 / rust-clipboard

System Clipboard interfacing library in Rust
Apache License 2.0
361 stars 72 forks source link

Can't run example on FreeBSD #88

Open ghost opened 2 years ago

ghost commented 2 years ago
> cargo run --example hello_world
.. <cut> ..

warning: `clipboard` (lib) generated 15 warnings
   Compiling clipboard v0.5.0 (/usr/home/xliiv/codespace/_tmp/rust-clipboard)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1b733kuccjd4fngh.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1by0g0ihopvvq3qq.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1cw0kftkiw71gl5z.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1dpn2bd4fdudjoyw.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1i5libu7qheck6me.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1kotqtiqyu1zmrd0.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1x92elnbnsofzwbz.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.1xzwf1frvwoq27me.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.2e7nrb2h40yd0nbf.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.2giyq4wzsoho6xyb.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.2isf7ay0nfomodjg.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.2o92tujfknrs2bpl.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.2ufdbxw1ato5d6hs.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.32h7zqi8tt180v0i.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.33yj691r27g0oyui.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.37sv2b8m7aw0na9k.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.3a4e5urfkcxwwvpv.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.3byqocsm7khaf9s9.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.3emuz9c2toikagtx.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.3kc2v2ktpwx3718q.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.3l3sq2exj2wwi20x.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.3ly7g1dmljj7n5yy.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.3njt8th6dfnq8jb3.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.417rl8heaf096omb.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.47o0p95xidxjzioc.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.4frif1qt66j2vbsx.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.4oycwzotsqx6l3fz.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.4rycs9qdjy3xrjbu.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.4s0pow7tfej57z4g.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.4xg80segbbrt1eb.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.5cxw0c8glduit52d.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.5zta1gpwvqscd8o.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.ann6iy1igyut04o.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.cob6r43l604dffu.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.jnd5p4we5o8kwdc.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.lnv34qwtal4o7p0.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.m7qpez9qdtce6no.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.mtfkfu5iqe9udt2.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.w2bwne2cbn39eua.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.x7dypj4qe7wpiw8.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.yceqjj3zud07p27.rcgu.o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1.4bl793uiaxxbe0if.rcgu.o" "-Wl,--as-needed" "-L" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/deps" "-L" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib" "-Wl,-Bstatic" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/deps/libclipboard-ea45412651c61e5d.rlib" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/deps/libx11_clipboard-20b73909393d4495.rlib" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/deps/libxcb-4be31895522d3844.rlib" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/deps/liblog-d141dfc4245c10fe.rlib" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/deps/libcfg_if-c36d063572492454.rlib" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/deps/liblibc-6c4f2187495a3f8e.rlib" "-Wl,--start-group" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-559def2745ea740e.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libpanic_unwind-370cd5974ac1f528.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libobject-3f70fb3d52df2100.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libmemchr-ff9d325945dbb3e1.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libaddr2line-15e6886f90bb2e2a.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libgimli-31ed3054339a0418.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_demangle-59d77492b1275b96.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libstd_detect-50ed39e83fca9250.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libhashbrown-ae1ba104983f279d.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libminiz_oxide-4f326a1e724f28af.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libadler-6dad2edc9fffc960.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_alloc-9a19d186cc9638dd.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libunwind-f141ec8e70eb17b0.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcfg_if-b1e321cf020c4daf.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/liblibc-26d9065b5654606c.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/liballoc-602c643ce77440db.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_core-ab43e47586270b72.rlib" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcore-a51716ebfee9a844.rlib" "-Wl,--end-group" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcompiler_builtins-a1266d41d2b323d0.rlib" "-Wl,-Bdynamic" "-lxcb" "-lxcb-render" "-lxcb-shape" "-lxcb-xfixes" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/usr/home/xliiv/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib" "-o" "/usr/home/xliiv/codespace/_tmp/rust-clipboard/target/debug/examples/hello_world-79d8fb229ab568b1" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: ld: error: unable to find library -lxcb
          ld: error: unable to find library -lxcb-render
          ld: error: unable to find library -lxcb-shape
          ld: error: unable to find library -lxcb-xfixes
          cc: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `clipboard` due to previous error

Any clue?

Update

Examples for x11-clipboard crate works

> cargo run --example paste
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/examples/paste`
some-pasted-text⏎
ghost commented 2 years ago

Works for x11-clipboard==0.6, see https://github.com/aweinstock314/rust-clipboard/pull/89

alexanderkjall commented 1 year ago

Migrating to https://crates.io/crates/cli-clipboard fixed my problems with building on freebsd