qq_34121797
Doutzen丶
采纳率100%
2018-02-01 03:21

JNA 调用fortran编写的Dll 问题

5
已采纳

本地环境:win7(32位) + jdk1.8(32位) + jna-4.2.1.jar;
代码:

IJnaTest.java :

    IJnaTest instanceDll=(IJnaTest) Native.loadLibrary("Dll1", IJnaTest.class);

    void MAIN1_mp_XAJMAIN(String Address,FloatByReference AA,IntByReference Cla);

Test.java:

public static void main(String[] args) {
    String Address="D://";
    FloatByReference AA=new FloatByReference(12.2f);
    IntByReference Cla=new IntByReference(1);

    IJnaTest it=IJnaTest.instanceDll;
    it.MAIN1_mp_XAJMAIN(Address, AA, Cla);

} 
报错信息如下:
    Exception in thread "main" java.lang.Error: Invalid memory access
    at com.sun.jna.Native.invokeVoid(Native Method)
    at com.sun.jna.Function.invoke(Function.java:374)
    at com.sun.jna.Function.invoke(Function.java:323)
    at com.sun.jna.Library$Handler.invoke(Library.java:236)
    at com.sun.proxy.$Proxy0.MAIN1_mp_XAJMAIN(Unknown Source)
    at com.jna.Test.main(Test.java:40)

求大神搭救!!






  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

相关推荐