-
Notifications
You must be signed in to change notification settings - Fork 397
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
ld cannot find -lmy_custom_c_library within custom docker image #347
Comments
I'm hitting a similar issue. Did you manage to make it work by any chance? :) |
Ah, I got it working! Here is how I did:
|
As of #727, we've added the search directories for |
This has been documented on the wiki and we've added a sample project. If you're building from source, you'll have to make sure it's found by the linker, likely using |
Hi, thanks for Cross --- it's a great tool!
I'm trying to use cross from a Mac to build a binary for Raspberry Pi 0 (arm-unknown-linux-musleabihf).
Plain rust code works great, but I'm having trouble linking to a C library,
pigpio
.The error is:
Here's what I've done so far:
Built a Docker image that contains my library. I've verified that it exists:
Specified library search path by adding to
build.rs
:println!(r"cargo:rustc-link-search=/usr/local/lib");
I've verified that
= note: "arm-linux-musleabihf-gcc" "-Wl,--as-needed" ... [lots of output]
contains both"-L" "/usr/local/lib"
and"-lpigpio"
.I'm running cross via:
and in my
Cross.toml
haveWithin my rust program itself, I'm declaring the C externs:
As far as I understand, this should all work.
I've done it plenty of times when compiling rust natively.
Hopefully I just have a typo somewhere...
Anyway, thanks again for the great tool.
Aside from this linking issue, it's working wonderfully!
The text was updated successfully, but these errors were encountered: