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

MacOS Support #160

Open
dladeira opened this issue Oct 4, 2022 · 3 comments
Open

MacOS Support #160

dladeira opened this issue Oct 4, 2022 · 3 comments

Comments

@dladeira
Copy link

dladeira commented Oct 4, 2022

When running on MacOS, I get this error:

= note: ld: library not found for -lX11
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

What I theorize that needs to be done is to specify the custom path x11 is installed in, which I think would look something like this

-L /opt/X11/lib -lX11

But I have no idea how.

--

Part 2, I did some magic and now I get this error

sh-3.2$ cargo run
   Compiling x11cap v0.4.1 (/Users/24ladeira_d/Documents/rust/clip)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "/var/folders/rj/lzqjylb12lz8jcrw5jkhcrbm0000gp/T/rustc5qrIXt/symbols.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.14d9p8hvgzzv4avt.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.1dr2d66vgmr0jdpv.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.1e7fnd2kpycyhbrj.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.1hur49qya2wnnau9.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.1ra5hsuh4rbl7io.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.1v3c0k8g3ba4ssl4.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.20s4vz5d3cw9k482.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.29ewvmj08wnh4vjf.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.2c7w0kl7lr8cw6v2.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.2eeal1n2hfv8ejde.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.2galoi7kqv1mt7xv.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.2glgmaoat4d7ojme.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.2ndstakvvr712wbf.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.2we4juq8t5mbn1jw.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.34bke9koivzs5noa.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.35qq45cm5ge1pndr.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.38fsia96509qock4.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.3ddz9n0f25wo7dqt.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.3eddglj6oxosourk.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.3jheyrfrtgte365z.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.3ub8bbitfsvsyic5.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.44zl67g5jkxrvdcd.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.481kjg37zubx75g8.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.4aa6ymjzbh7n2zb8.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.56akzbgmvtl7ld95.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.58bensf2iihrnwc6.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.59h63c3nkggalhb1.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.73ees3ymcy0rnpv.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.bkmbe9njnbtxl0k.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.ddmu2ci7x84frjr.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.hf87hf5s6zbcu93.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.veq2gg3yup0q30f.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.wq7s76kaxuic5qi.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.xczijnrsmrkhz61.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.xdrrr6w0kjevtsv.rcgu.o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55.5g3nim6xklq602vr.rcgu.o" "-L" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps" "-L" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/libx11-3ff60b79d956c8b1.rlib" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/liblibc-b21ff77401e6f30a.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-0f7ee384278ce82b.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-6023318e4257fdb3.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-50ed95d28fda9497.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-114781e2905bc242.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-841a5df74cbbcf8e.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-9b35810dd2e8e276.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-d44decaafa04c51d.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-aa335e35e4a7724c.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-7ac72202be300078.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-2930c6f21f36f92f.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-654445a53da668f3.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-ce034a3eed8d4113.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-51412ab8efb0f481.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-1c20aac4d9e33893.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-5559092a2ede5191.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-05250b6a4768a099.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-10f98b32877a2067.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-56d27115b82c9961.rlib" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-8b28a0a374c38504.rlib" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/24ladeira_d/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/24ladeira_d/Documents/rust/clip/target/debug/deps/x11cap-f338dbb02c551b55" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_XCloseDisplay", referenced from:
                _$LT$x11cap..WindowConnection$u20$as$u20$core..ops..drop..Drop$GT$::drop::h916ce4925ce236c1 in x11cap-f338dbb02c551b55.34bke9koivzs5noa.rcgu.o
            "_XGetImage", referenced from:
                x11cap::Capturer::capture_frame::hd8dbecbaeb3fc591 in x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o
            "_XRRGetMonitors", referenced from:
                x11cap::Capturer::new::ha1489227233ecd15 in x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o
            "_XDefaultScreen", referenced from:
                x11cap::WindowConnection::new::h32d4a776aec7d48b in x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o
            "_XRootWindow", referenced from:
                x11cap::WindowConnection::new::h32d4a776aec7d48b in x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o
            "_XDestroyImage", referenced from:
                x11cap::Capturer::capture_frame::hd8dbecbaeb3fc591 in x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o
                _$LT$x11cap..Image$u20$as$u20$core..ops..drop..Drop$GT$::drop::hef117b07f3481f87 in x11cap-f338dbb02c551b55.34bke9koivzs5noa.rcgu.o
            "_XOpenDisplay", referenced from:
                x11cap::WindowConnection::new::h32d4a776aec7d48b in x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o
            "_XGetGeometry", referenced from:
                x11cap::WindowConnection::new::h32d4a776aec7d48b in x11cap-f338dbb02c551b55.100xbscdnqas5msy.rcgu.o
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `x11cap` due to previous error
@AltF02
Copy link
Owner

AltF02 commented Oct 7, 2022

I unfortunately don't have access to a macos system, and I am pretty unfamiliar with its inner workings. Is this using x11 or x11-dl?

@dladeira
Copy link
Author

X11

@AltF02
Copy link
Owner

AltF02 commented Oct 11, 2022

What features are you using? The solution proposed in #94 could work for you. It might also work for you temporarily if you run cargo run -- -lx11 as found in https://trac.macports.org/changeset/108113, which seems to have the same linker output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants