[zeromq-dev] Czmq Windows mingw32 build: dllimport

Kevin Wang kevin at spikegadgets.com
Sun Apr 15 00:25:32 CEST 2018


I have been using cmake on Linux to cross compile for Windows 32-bit. 
How do I specify the mingw 32-bit version using configure? If I just 
specify --host= i686-w64-mingw32, wouldn't that use the win64 version?

I use CMake and the i686-w64-mingw32-gcc-win32 toolchain, and compiling 
on Linux or Windows both give the same thing. When compiling, there are 
lots of those "redeclared without dllimport... " warnings, and when 
linking, a lot of "undefined reference to `_imp__zrex_hits" for all files.

I fix it by changing line #50 in czmq_library.h from 
"__declspec(dllimport)" into "__declspec(dllexport)"

That fixes all warnings and errors, though i haven't actually gotten a 
chance to use the libraries yet so I'm unsure if it works yet. I also 
don't know why that works or if changing that line is a bad move to make...


On 04/13/2018 12:13 PM, Luca Boccassi wrote:
> Autoconf should work and it's your best bet with mingw, what is the 
> problem exactly?
>
>
> On Fri, 13 Apr 2018, 18:53 Kevin Wang, <kevin at spikegadgets.com 
> <mailto:kevin at spikegadgets.com>> wrote:
>
>     Hi all,
>     I have been developing on Linux for the past few months and it is
>     time to also port my code to windows for some customers. The
>     problem is that I am not accustomed to it. I have to use the Mingw
>     tool chain because we compile Qt with it.
>
>     The autogen-configure-make steps don’t work so I have been using CMake
>
>     When I finally get to building Czmq, I encounter a bunch of the
>     following:
>     ____ redeclared without dllimport attribute: previous dllimport
>     ignores
>     And
>     ____ redeclared without dllimport attribute after being referenced
>     with dll linkage
>
>     My cmake command is simply “cmake .. -G “MinGW Makefiles”
>
>     Has anyone been able to compile with these settings recently or a
>     windows developer that can help a windows newbie?
>
>     Thanks
>
>     Kevin
>
>
>     Sent from my iPhone
>     _______________________________________________
>     zeromq-dev mailing list
>     zeromq-dev at lists.zeromq.org <mailto:zeromq-dev at lists.zeromq.org>
>     https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20180414/603c6f55/attachment.htm>


More information about the zeromq-dev mailing list