Missing Downloaded Libraries? #1763
-
|
I'm trying to cross-compile a Rust program for Raspberry Pi (aarch64), but kept getting errors for missing alsa and libssl libraries. I was able to install the arm64 version of those packages but still got the error, even though the PKG_CONFIG_PATH directory /usr/lib/aarch64-linux-gnu/pkgconfig contains alsa.pc and libssl.pc. What else am I missing? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
The reason you are encountering this error is that To fix this, you need to provide a custom Docker image to 1. Create a Custom DockerfileCreate a file named ARG CROSS_BASE_IMAGE
FROM $CROSS_BASE_IMAGE
# Add the foreign architecture and install dependencies
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install --assume-yes --no-install-recommends \
libasound2-dev:arm64 \
libssl-dev:arm642. Configure CrossTell [target.aarch64-unknown-linux-gnu]
dockerfile = "Dockerfile.aarch64"3. Build with the Custom ImageWhen you run your build command, cross build --target=aarch64-unknown-linux-gnuTip You generally do not need to manually set Why your host libraries didn't workBy default, Does your project require any other C dependencies, or are ALSA and OpenSSL the only ones? |
Beta Was this translation helpful? Give feedback.
The reason you are encountering this error is that
crossruns your build inside a container. While you may have installed theaarch64libraries on your host machine, they are not visible to the compiler inside the isolated build environment.To fix this, you need to provide a custom Docker image to
crossthat contains the necessary development headers and libraries for your target architecture.1. Create a Custom Dockerfile
Create a file named
Dockerfile.aarch64in your project root. You will extend the defaultcrossimage for your target and install the required packages usingdpkgarchitecture support.