mkdir paho.mqtt.c/build-mingw
cd paho.mqtt.c/build-mingw
cmake .. -GNinja -DCMAKE_C_FLAGS="-m32 -D_WINDOWS" -DPAHO_BUILD_STATIC=TRUE -DPAHO_WITH_SSL=TRUE -DOPENSSL_SEARCH_PATH=../../build/mingw -DPAHO_BUILD_SAMPLES=FALSE -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain.win32.cmake -DOPENSSL_INCLUDE_DIR=../../build/mingw/include -DOPENSSL_LIB=../../build/mingw/lib/libssl.a -DOPENSSLCRYPTO_LIB=../../build/mingw/lib/libcrypto.a
ninja
Example applications I've tried:
Building on Ubuntu 16.04
i686-w64-mingw32-gcc (GCC) 6.2.1 20161119
OpenSSL version 1.0.2l, built from source
Occurs with version 1.2.0 of libpaho and with trunk
The issue is usually a segfault at a low value address (Ex: wine: Unhandled page fault on read access to 0x00000008)
Running with MQTT_C_CLIENT_TRACE=ON and MQTT_C_CLIENT_TRACE_LEVEL=MAXIMUM there are a lot of errors like this before the crash occurs:
Unknown error locking mutex
Error No such device or address unlocking mutex
Error -1 waiting for semaphore
Max stack depth exceeded
Is there a flag or something I might be missing? Or do you all have any thoughts about where the problem may exist?
Thanks!