[zeromq-dev] CZMQ Windows Build

Laurent Alebarde l.alebarde at free.fr
Tue Oct 1 15:16:58 CEST 2013


Some months ago, I could build libzmq, czmq and libcurve under MinGW, 
and also via cross-compilation. I remember I had to suppress the 
hardcoded compiler/linker substitute CC=gcc in 
builds/mingw32/Makefile.mingw32, and do : mingw32-make -f Makefile.mingw32

Finally, I found it easier to use cross compilation. I created this 
script, from here 
<http://www.tinc-vpn.org/examples/cross-compiling-windows-binary/> :
#!/bin/sh
PREFIX=i686-pc-mingw32
export CC=$PREFIX-gcc
export CXX=$PREFIX-g++
export CPP=$PREFIX-cpp
export RANLIB=$PREFIX-ranlib
export PATH="/usr/$PREFIX/bin:$PATH"
export DEL=rm exec "$@"

say, name it set4cross

Modify Makefile.mingw32 : suppress CC=gcc, remplace g++ by $(CXX), and 
del by $(DEL).

Then, build with (say i686-pc-mingw32 is your cross compiler name) :
./set4cross ./autogen.sh
./configure --host=i686-pc-mingw32
./set4cross make -f Makefile.mingw32
mkdir /usr/i686-pc-mingw32/lib
ln -s <some path>/builds/mingw32/libzmq.dll <your main project 
path>/libzmq.dll
ln -s <some path>/builds/mingw32/libzmq.dll.a 
/usr/i686-pc-mingw32/lib/libzmq.dll.a
ln -s /usr/lib/gcc/i686-pc-mingw32/4.7.3/libgcc_s_sjlj-1.dll <your main 
project path>/libgcc_s_sjlj-1.dll
ln -s /usr/lib/gcc/i686-pc-mingw32/4.7.3/libstdc++-6.dll <your main 
project path>/libstdc++-6.dll

Check you have also (your cross compiler path may be different) - if 
not, make a symbolic link :
/usr/i686-pc-mingw32/lib/libstdc++.dll.a
/usr/i686-pc-mingw32/usr/include/zmq_utils.h
/usr/i686-pc-mingw32/usr/include/zmq.h

I did test a project from the Guide both under wine and in a Windows XP 
VirtualBox with success
I have not updated my windows builds in the time between.

Please, let us informed of your trials.

Cheers,


Laurent.


Le 01/10/2013 12:59, HG Choi a écrit :
> To Developers,
>
> I usually prefer to deal with Linux, but I must now build a Windows 
> client application that makes use of ZMQ, CZMQ, and FMQ. I was able to 
> build the latest ZMQ successfully. Now I am trying to build the latest 
> release of CZMQ in Windows 7 x86_64 architecture. I have tried to use 
> the MVS project included in the download but I have not succeeded. I 
> would just like to know if building the latest CZMQ in windows has 
> been tested. If so, and it worked, there is no more to be said.
>
> I will keep trying to do so with MSV, but am also considering using 
> MinGW or Cygwin. Or is a cross compile from Linux to Windows using the 
> right compiler a viable option?
>
> Any sort of guidance on the issue would be helpful!
>
> Thank you,
>
> HG Choi
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

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


More information about the zeromq-dev mailing list