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

Linking fails on MacOSX (missing -luuid) #23

Closed
hrydgard opened this issue Dec 21, 2021 · 5 comments · Fixed by #35
Closed

Linking fails on MacOSX (missing -luuid) #23

hrydgard opened this issue Dec 21, 2021 · 5 comments · Fixed by #35

Comments

@hrydgard
Copy link

I'm trying (in a non-embark-related side project) to use this from a build.rs on a Macbook Air M1, but any use of hassle-rs causes a linker error about a missing -luuid when trying to build the build.rs:

error: linking with cc failed: exit status: 1
|
= note: "cc" "-arch" "arm64" "/Users/hrydg/dev/rgb/target/debug/build/rgb-dca230a1aa5b7e54/build_script_build-dca230a1aa5b7e54.10m9mxptggm1u1hd.rcgu.o" "/Users/hrydg/dev/rgb/target/debug/build/rgb-dca230a1aa5b7e54/build_script_build-dca230a1aa5b7e54.14wrnmxnrm9y2a17.rcgu.o" "/Users/hr

[SNIP]

libcompiler_builtins-56bb43a121401f7f.rlib" "-luuid" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/hrydg/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/hrydg/dev/rgb/target/debug/build/rgb-dca230a1aa5b7e54/build_script_build-dca230a1aa5b7e54" "-Wl,-dead_strip" "-nodefaultlibs" "-undefined" "dynamic_lookup"
= note: ld: library not found for -luuid
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Basically, seems like some library that hassle depends on is trying to link with -luuid, which apparently is not a thing on Mac (libuuid is header-only, apparently).

(note: just thought it might be good to report, you probably should not give this any kind of priority, heh)

@MarijnS95
Copy link
Member

This is the ancient com library.

There is a replacement, Microsoft's com-rs crate, and the conversion sits on the ms-com-rs branch here - that should resolve this linker error (it solves the exact same one on Android).

Unfortunately, just as I was planning to clean up and PR the conversion, Microsoft announced its windows-rs crate with COM interop, auto-generated bindings and all. To this day there is still no consensus on whether com-rs will live on and be maintained (it's still sees occasional fixes and releases), or whether it will be superseded by windows-rs which carries lots of similar code and intent. The latter situation requires a few minor changes to be carried by windows-rs to support Linux (and Mac) even if we just need some generated bindings and the COM vtable boilerplate.

@hrydgard
Copy link
Author

hrydgard commented Dec 22, 2021

Ok, well, maybe let's see how that shakes out, and I can play with the ms-com-rs branch in the meantime, thanks for letting me know about it! I think we should leave this issue open in the meantime, to make it easy to find for others potentially running into the same thing.

@expenses
Copy link

expenses commented Jan 1, 2022

Installing ossp-uuid (brew install ossp-uuid) fixed this for me.

Looks like it's the same library.

@hrydgard
Copy link
Author

hrydgard commented Jan 1, 2022

@expenses are you on an x86 mac? On M1, installing that did not fix it for me.

@expenses
Copy link

expenses commented Jan 1, 2022

I am, yeah.

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

Successfully merging a pull request may close this issue.

3 participants