Bindgen on MacOS 14 fails to link dylib with lib not found error #2673
Replies: 2 comments
-
Hi, it seems you're linking an ARM64 executable against an Intel x64 library. We're working on making the OSX ARM64 library available. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Closed as it seems this is not a bindgen issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Macos: 14 / M1
rustc 1.73.0 (cc66ad468 2023-10-03)
Homebrew clang version 17.0.3
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin
Hi,
I'm working on a Rust wrapper for quaser DB that has a C API for all FFI clients.
The entire C api is wrapped in one libqdb_api.dylib
I am using Bindgen to generate the Rust bindings and that works well meaning I got all bindings generated and the project compiles.
However, the tests don't runs because the C headerfiles rely on linking against libqdb_api and somehow I cannot convince cargo to find this lib required for linking. Also, running a simple example code fails with the same error.
I know that I cannot set the DYLD_LIBRARY_PATH as an env variable because of OSX System Integrity Protection (SIP). Rather, in a similar issue, it was suggested to use the instal_name_tool instead and so I tried the following:
Which is supposed to switch the rpath to the target folder since the build script is executed relative to the target folder. However, this does not worked either for me.
The question is: How do I configure cargo to find the dylib, which is in the project folder?
Technically, I can copy the libqdb_api.dylib into any other folder, and I actually tried it but nothing worked so I believe my configuration must be wrong.
Any help is appreciated.
What I did:
-relative path is: qdb/lib
Log files:
Github repo
Beta Was this translation helpful? Give feedback.
All reactions