Libraries for cross-compilation to x86_64-pc-windows-gnu #1056
-
Hello, I am trying to cross-compile from linux (arch) to "x86_64-pc-windows". Everyting compiles fine for "x86_64-unknown-linux-gnu", but I am getting following error when I do: cross build --release --target x86_64-pc-windows-gnu
I tried to have a Dockerfile with this:
but still get the same error. So, how do I get these libraries? Thank you for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The target you are building for, A few tools and frameworks help for this. For example, |
Beta Was this translation helpful? Give feedback.
The target you are building for,
x86_64-pc-windows-gnu
, is using GCC for a Windows target, but the host OS is x86_64 Linux GNU. So, installinglibmysqlclient-dev
viaapt
installs it forx86_64-unknown-linux-gnu
. If you would like to use a crate depending on your library, you'll have to build it from source or use a package manager that has it built. Some packages, likelibz-mingw-w64-dev
, are available from official repositories, but many others aren't.A few tools and frameworks help for this. For example,
vcpkg
could let you use it as part of your build step, or you can download it from source and compile it with our toolchain. You can also use MXE (M Cross-Environment).