How to add postgres library before compilation #1163
Replies: 3 comments 15 replies
-
See the wiki on working with external dependencies. In this case, you'd likely want in [target.aarch64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install libpq-dev:$CROSS_DEB_ARCH"
] And then it should just work. |
Beta Was this translation helpful? Give feedback.
-
If you are using a procedural macro, you will need the dependencies for the proc macro on the host, and the dependencies for the post-expansion crate on the target. In this case, both are Let me know if this fixes the issue. |
Beta Was this translation helpful? Give feedback.
-
Sweet! this totally solved my issue here, although I had to add some timezone stuff. [target.aarch64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"ln -snf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && echo America/Los_Angeles > /etc/timezone",
"apt-get update && apt-get --assume-yes install libgdal-dev:$CROSS_DEB_ARCH",
] |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to cross-compile from my x86 CPU to the target aarch64-unknown-linux-gnu and my code needs to be linked with libpq (the Postgres SQL library).
The error I get is: /usr/bin/ld: cannot find -lpq
I have tried multiple things already and none of them have worked. I think the biggest confusion for me is that the docker image that cross runs is an x86 image but the binary needs to be linked with an aarch64 version of libpq.
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions