To compile for Windows, you need to install MinGW toolchain and set up environment accordingly.
You also need to compile OpenSSL with MinGW. As for zlib, Ubuntu already provides the MinGW version of it in the libz-mingw-w64-dev package.
Works this way in Ubuntu 18.04, should work in 16.04 too:
Code:
# Install necessary packages
apt-get install git build-essential mingw-w64 libz-mingw-w64-dev
# Prepare environment
export CROSS_COMPILE=x86_64-w64-mingw32-
# Get and build OpenSSL; use version 1.0.x, build fails with 1.1.x
openssl_ver=1.0.2s
wget https://www.openssl.org/source/openssl-$openssl_ver.tar.gz
tar xf openssl-$openssl_ver.tar.gz
cd openssl-$openssl_ver
openssl_dir=$PWD
./Configure mingw64
make
# Get and build rtmpdump
cd ..
git clone https://github.com/sstativa/rtmpdump-ksv.git
cd rtmpdump-ksv
make SYS=mingw XCFLAGS=-I$openssl_dir/include XLDFLAGS=-L$openssl_dir
# Put it all together
cd ..
mkdir result
cp -t result rtmpdump-ksv/*.exe rtmpdump-ksv/librtmp/librtmp-1.dll /usr/x86_64-w64-mingw32/lib/zlib1.dll
Then copy everything from the result directory to Windows.
Bookmarks