[zeromq-dev] jzmq on Windows with mingw32

Koert Kuipers Koert.Kuipers at diamondnotch.com
Mon Dec 27 23:07:34 CET 2010


Ok I managed to build jzmq with ming32.
I am pretty sure that I made unnecessary changes and messed some things up, but it seems to work. So perhaps someone who understands this process better can make more sense of it.

Steps I had to do:

* Download jzmq on linux

* Modify configure.in
28,30d27
< AC_PROG_LIBTOOL
< AC_PROG_SED
< AC_PROG_AWK
33a31,39
> AC_LIBTOOL_WIN32_DLL
> # AC_PROG_LIBTOOL
> LT_INIT([win32-dll])
> AC_PROG_SED
> AC_PROG_AWK
>
> # set JNI flags
> CPPFLAGS="$CPPFLAGS -D_JNI_IMPLEMENTATION_ -Wl,--kill-at"
> LDFLAGS="$LDFLAGS -D_JNI_IMPLEMENTATION_ -Wl,--kill-at"
109a116,118
>     *mingw32*)
>             CPPFLAGS="$CPPFLAGS -I${JAVA_HOME}/include/win32"
>     ;;

* Run ./autogen.sh on linux (to avoid autotools on mingw32)

* copy the whole directory to windows

* Move java JDK to a path without spaces. The configure script gets confused when it sees spaces in a directory path.

* copy libtool from my zeromq setup directory to my jzmq setup directory (somehow the standard libtool with mingw32 does not work)

* in libtool there is a section specific to allow_undefined for different host systems. For mingw change "allow_undefined=yes" to "allow_undefined=no"

* Run ./configure

* In the three Makesfiles that it produces (on in ., one in ./src and one in ./perf) fix some slashes (some backslashes sneaked in there which blow up the make)

* make

* make install


From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Koert Kuipers
Sent: Monday, December 27, 2010 2:52 PM
To: ZeroMQ development list
Subject: Re: [zeromq-dev] jzmq on Windows with mingw32

I get the same error with the example program:
C:\Devel\src\zeromq-jzmq-a97e15a\perf>java -Djava.library.path=c:\Devel\mingw\ms
ys\1.0\local\bin -classpath c:\Devel\mingw\msys\1.0\local\bin;c:\Devel\java\lib\
*;. local_lat tcp://127.0.0.1:555 1 100
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.zeromq.ZMQ$Contex
t.construct(I)V
        at org.zeromq.ZMQ$Context.construct(Native Method)
        at org.zeromq.ZMQ$Context.<init>(ZMQ.java:174)
        at org.zeromq.ZMQ.context(ZMQ.java:120)
        at local_lat.main(local_lat.java:36)


nm libjzmq-0.dll shows (partial listing):

61682c30 T _DeleteCriticalSection at 4
61682960 T _DllMain at 12
616810c0 T _DllMainCRTStartup at 12
61682c40 T _EnterCriticalSection at 4
61682c08 T _FreeLibrary at 4
61682c28 T _GetLastError at 0
61682bf0 T _GetModuleHandleA at 4
61682bf8 T _GetProcAddress at 8
61682c38 T _InitializeCriticalSection at 4
61681404 T _Java_org_zeromq_ZMQ_00024Context_construct at 12
61681464 T _Java_org_zeromq_ZMQ_00024Context_finalize at 8
61681f3c T _Java_org_zeromq_ZMQ_00024Poller_run_1poll at 32
61681af4 T _Java_org_zeromq_ZMQ_00024Socket_bind at 12
61681bbc T _Java_org_zeromq_ZMQ_00024Socket_connect at 12
61681614 T _Java_org_zeromq_ZMQ_00024Socket_construct at 16
61681764 T _Java_org_zeromq_ZMQ_00024Socket_finalize at 8
61681878 T _Java_org_zeromq_ZMQ_00024Socket_getBytesSockopt at 12
616817c4 T _Java_org_zeromq_ZMQ_00024Socket_getLongSockopt at 12
61681df4 T _Java_org_zeromq_ZMQ_00024Socket_recv at 12
61681c84 T _Java_org_zeromq_ZMQ_00024Socket_send at 16
61681a0c T _Java_org_zeromq_ZMQ_00024Socket_setBytesSockopt at 16
61681968 T _Java_org_zeromq_ZMQ_00024Socket_setLongSockopt at 20
616812b0 T _Java_org_zeromq_ZMQ_make_1version at 20
61681280 T _Java_org_zeromq_ZMQ_version_1full at 8
6168128c T _Java_org_zeromq_ZMQ_version_1major at 8
61681298 T _Java_org_zeromq_ZMQ_version_1minor at 8
616812a4 T _Java_org_zeromq_ZMQ_version_1patch at 8
61682c48 T _LeaveCriticalSection at 4
61682c00 T _LoadLibraryA at 4
61682c20 T _TlsGetValue at 4
61682c18 T _VirtualProtect at 16
61682c10 T _VirtualQuery at 12
61686088 B __CRT_MT
61682c9c T __CTOR_LIST__

From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Koert Kuipers
Sent: Monday, December 27, 2010 1:20 PM
To: zeromq-dev at lists.zeromq.org
Subject: [zeromq-dev] jzmq on Windows with mingw32

Has anyone successfully build jzmq on windows with mingw32? I managed to tweak the configure.in so that it creates dynamic libraries on mingw32, so I now have libjzmw-0.dll. But when I load zmq.jar I get the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.zeromq.ZMQ$Contex
t.construct(I)V
        at org.zeromq.ZMQ$Context.construct(Native Method)
        at org.zeromq.ZMQ$Context.<init>(ZMQ.java:174)
        at org.zeromq.ZMQ.context(ZMQ.java:120)
        at com.diamondnotch.Main.main(Main.java:2
29)


I know that zmq.jar can find libjzmw-0.dll, since when I rename libjzmw-0.dll it throws a different error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no libjzmq-0 in java.
library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.zeromq.ZMQ.<clinit>(ZMQ.java:29)
        at com.diamondnotch.Main.main (Main.java:2
29)

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


More information about the zeromq-dev mailing list