我在 Windows 7 64 位上安装了 32 位版本的 Mingw 4.7.2(使用安装程序)。
我在 Eclipse C++ 项目中使用 MinGW 来构建一个 .dll 文件。到目前为止一切正常。
但是我使用这个 .dll 通过 JNI 包含在一个 java 项目中。当我在 java 项目中调用 .dll 的函数时,异常 "Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\path\mylib.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform"
被抛出。
所以看起来我需要构建一个 64 位版本的 DLL。
所以我的问题是:
问候马克
编辑:正如您在下面的评论中看到的,我已经尝试设置 -m64 标志来构建 64 位 dll。这导致错误:
"sorry, unimplemented: 64-bit mode not compiled in"
.那么有没有办法让 64 位模式在 mingw32 中运行。
最佳答案
我最近遇到了同样的问题,安装了 MinGW-64
版本启用 -m64
给我的旗帜。您可以从 here 获得自动构建.
编辑:有些人 ( rubenvb
) 在 Personal Builds
中做得很好:
有 gcc 4.7.4 here甚至 4.8.0 here .
关于eclipse - 在 Eclipse 中使用 MinGW 32 位构建 64 位 dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16955909/