Closed ckoehler closed 6 months ago
is this solved? I always have static link not found error
Thanks,
Jianshu
No, not solved. Haven’t further pursued it.
I actually have some experience with this: In your application directory, create a file at .cargo/config.toml and put the following lines into it:
[build]
target = "armv7-unknown-linux-gnueabihf"
rustflags = ["-C", "link-args=-L/lib/arm-linux-gnueabihf"]
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-g++"
Try recompiling and let me know if that works.
PS: Make sure you add your cross-compiler binary dir to your environment path:
Dockerfile:
ENV PATH="${PATH}:${ARM_TC_PATH}/bin"
I've actually solved this with cargo zigbuild. It's magic!
Hi there!
I am trying to build my library with zmq statically compiled in. I am currently doing that for my host arch with a vendored build, which generates a portable single binary that doesn't depend on ZMQ being installed. I'd like to do the same for other architectures, but am not getting it to work and wondering if it's even supported.
I am building in the
rust:slim-buster
Docker image (on my M1 mac). I dorustup target add armv7-unknown-linux-gnueabihf
andapt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
. Thencargo build --target armv7-unknown-linux-gnueabihf
. It seems to build okay, but won't link:The file does look right:
Any ideas?
Thanks!