syl5i5j
2009-07-18 16:47 阅读 275
已采纳

jnative怎么在linux下调用c++的dll库

最近在做一个项目,需要用java在linux下调用C++的dll库,以下是代码:
JNative n = null;
try
{
n = new JNative("/home/xx/libxsqlite3.so","InitialDatabase");
n.setRetVal(Type.INT);
n.invoke();
}
finally
{
if (n != null) n.dispose();
}
运行之后报错:
org.xvolks.jnative.exceptions.NativeException: Function InitialDatabase not found in library
at org.xvolks.jnative.JNative.nLoadLibrary(Native Method)
at org.xvolks.jnative.JNative.loadLibrary(JNative.java:534)
at org.xvolks.jnative.JNative.(JNative.java:510)
at org.xvolks.jnative.JNative.(JNative.java:427)
at Test.testJNative(Test.java:24)
at Test.main(Test.java:52)

注:jnative下载的包里的libJNativeCpp.so文件已经拷贝到/usr/lib路径下
有人知道是怎么回事吗?

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

1条回答 默认 最新

相关推荐