building JNA / native on MingW

71 views
Skip to first unread message

Daniel Doubrovkine

unread,
May 22, 2013, 6:44:01 PM5/22/13
to jna-...@googlegroups.com
I had a working build environment on my Win7/64 with mingw.

Some recent update seems to have broken it. Got gcc 4.6.2, headers updated, etc. Anyone knows what this is?

     [exec] In file included from c:/Users/dblock/Source/GitHub/jna/dblock/native/libffi/src/closures.c:112:0:
     [exec] c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/string.h:38:40: error: expected declaration specifiers or '...' before '(' token

     [exec] c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/string.h:38:40: error: expected declaration specifiers or '...' before '(' token

     [exec] c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/string.h:38:40: error: expected declaration specifiers or '...' before '(' token

     [exec] In file included from c:/Users/dblock/Source/GitHub/jna/dblock/native/libffi/src/closures.c:233:0:
     [exec] c:/Users/dblock/Source/GitHub/jna/dblock/native/libffi/src/dlmalloc.c: In function 'internal_realloc':
     [exec] c:/Users/dblock/Source/GitHub/jna/dblock/native/libffi/src/dlmalloc.c:3894:9: warning: implicit declaration of function 'bcopy' [-Wimplici
t-function-declaration]
     [exec] c:/Users/dblock/Source/GitHub/jna/dblock/native/libffi/src/dlmalloc.c:3894:9: warning: incompatible implicit declaration of built-in funct
ion 'bcopy' [enabled by default]
     [exec] make[3]: *** [src/closures.lo] Error 1
     [exec] make[2]: *** [all-recursive] Error 1
     [exec] make[1]: *** [all] Error 2
     [exec] make: *** [../build/native-win32-x86/libffi/.libs/libffi.a] Error 2

Timothy Wall

unread,
May 22, 2013, 9:00:17 PM5/22/13
to jna-...@googlegroups.com
That kinda looks like the same issue that Dan Rollo was getting. I'm still using gcc3 on XP; I'd have to check the mingw versions, but I've never been able to reproduce.

Fundamentally memcpy support is not being found, which results in a (broken) fallback to bcopy. Dan has a workaround PR posted that might work for you.
> --
> You received this message because you are subscribed to the Google Groups "Java Native Access" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Daniel Doubrovkine

unread,
May 23, 2013, 7:41:48 AM5/23/13
to jna-...@googlegroups.com
Oh I remember that, it worked. Thanks!

Daniel Doubrovkine

unread,
May 25, 2013, 12:55:41 PM5/25/13
to jna-...@googlegroups.com
Fyi, after carefully reading https://github.com/twall/jna/blob/master/www/WindowsDevelopmentEnvironment.md I got it working. Needed the 64-bit version of MingW, JAVA_HOME that is set to the 64-bit version of the JDK, and CC=mingw edited in Makefile. 

I did clarify those instructions a bit for future reference, too.
Reply all
Reply to author
Forward
0 new messages