-
Notifications
You must be signed in to change notification settings - Fork 39
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: Library not loaded: @rpath/libwatcher-c.0.dylib, Reason: no LC_RPATH's found #59
Comments
I'm loading the library from Go using cgo. I fixed this by passing an explicit rpath to the linker by using the env var |
I think we can fix this -- I'll try to get on it today |
Does the |
Looking at this more closely, I think the issue might also involve cgo itself not adding the appropriate rpath. libwatcher-c also probably might need an rpath on Apple to properly load libc++, but I think cgo needs to add an rpath to find libwatcher-c |
I ran otool on the libcwatcher on the next branch. There's no LC_RPATH in there... I don't know much about the linker, or linking shenanigans. I'm not sure
|
Maybe this SO answer can help: https://stackoverflow.com/a/71321163/1352334 |
I think the current state of the next branch might be ok. AFAICT:
|
(IOW, I don't know if we need an LC_RPATH in the library, since it seems unused) |
After installing the library on macOS following these instructions, I get the following error:
It looks like it can be fixed in the cmake definition: https://discourse.cmake.org/t/how-to-get-an-lc-rpath-and-rpath-prefix-on-a-dylib-on-macos/5540/4
The text was updated successfully, but these errors were encountered: