This is an attempt to revive the work started by @theuni in #6819, and hopefully close issues #7943 and #6681.
Even if we still can’t fix the Windows linking issues, it might be worth moving to the newer ZeroMQ version. Release notes as follows:
00MQ version 4.1.5 stable, released on 2016/06/17
1================================================
2* Fixed 1673 - CMake on Windows put PDB in wrong directory.
3* Fixed 1723 - Family is not set when resolving NIC on Android.
4* Fixed 1608 - Windows 7 TCP slow start issue.
5* Fixed 1806 - uninitialised read in curve getsockopt.
6* Fixed 1807 - build broken with GCC 6.
7* Fixed 1831 - potential assertion failure with latest libsodium.
8* Fixed 1850 - detection issues with tweetnacl/libsodium.
9* Fixed 1877 - Avoid terminating connections prematurely
10* Fixed 1887 - zmq_bind IPv4 fallback still tries IPv6
11* Fixed 1866 - fails to build on SunOS 5.10 / Solaris 10
12* Fixed 919 - ZMQ_LINGER (related to [#1877](/bitcoin-bitcoin/1877/))
13* Fixed 114 - cannot unbind with same endpoint with IPv6 enabled.
14* Fixed 1952 - CMake scripts not part of release tarballs
15* Fixed 1542 - Fix a crash on Windows when port 5905 is in use.
16* Fixed 2021 - Fix building on sparc32.
The changes to enable static linking in ZeroMQ have been made in #1615 and then a follow up in #1978 / #1979.
We no longer need the headergaurd patch from #6819, as those changes seem to be in src/windows.hpp. Introduced in #901.
Hopefully pulling all this info together means we can get this working.