Cross-Compiling a program on Linux for Windows using cmake

Viewed 495

im trying to cross compile nextcloud on my Linux system for Windows 64x
So far i managed to get the c and cxx compiler running, but cmake wont find openssl.

c compiler = x86_64-w64-mingw32-gcc-posix
cxx compiler = x86_64-w64-mingw32-g++-posix

The thing is cmake finds openssl while using the linux compiler.
c compiler= cc
cxx compiler= c++

Im not that experienced in cross compiling.
Do i need the windows version of openssl somewhere on my linux mashine to make cmake find it? I tried to set the CMAKE_PREFIX_PATH to the linux version of openssl but that seems somewhat silly to me.

Thanks for an help

1 Answers

The libssl your linux compiler find is an elf library which is not compatible with the pei format needed for windows. Mingw cannot link against this library.

You need a mingw version of libssl and any library you want to link against. If you cannot find a mingw version, you will need to cross compile it yourself.

Related