简体   繁体   中英

Cross-Compiling a program on Linux for Windows using cmake

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM