Building 64 bit dll with MinGW 32 bit in Eclipse

Mar*_*arc 8 eclipse dll mingw eclipse-cdt

I installed the 32 bit version of Mingw 4.7.2 (using the installer) on my Windows 7 64 bit. I use MinGW in an Eclipse C++ project in order to build a .dll file. So far everything works.

However I use this .dll to be included in a java project via JNI. And when I call a function of the .dll in the java project the exception "Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\path\mylib.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform" is thrown. So it seem like I need to build an 64 bit version of the DLL.

So my questions are:

  1. Can I build an 64 bit DLL with MinGW 32 bit or do I need the MinGW 64 bit version for that?
  2. If yes how do I need to adjust the MinGW and/or Eclipse Settings to do so?

Regards Marc

编辑:正如您在下面的注释中所看到的,我已经尝试将-m64标志设置为构建64位dll.这导致错误:"sorry, unimplemented: 64-bit mode not compiled in".那么有没有办法在mingw32中运行64位模式.

Gau*_*lio 7

我最近遇到了同样的问题,安装MinGW-64版本-m64为我启用了标志.您可以从这里获得自动构建.

编辑:有些人(rubenvb)在以下方面做得很好Personal Builds:

有GCC 4.7.4 这里甚至4.8.0 在这里.