3
votes

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
If I may make a recommendation, MXE worked quite well in the past for me: blog.kitware.com/cc-development-for-windows-sans-windows. - Aziuth
thx, i will try your recommendation. But that will not resolve my problem with openssl right? CMake will still require a mingw version of openssl as mentioned by @yflelion below - Bubbleshine

1 Answers

0
votes

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.