libpd on java UnsatisfiedLinkError

时间:2016-02-04 09:23:11

标签: java libpd

我正在尝试将$Path = "\\c03fps01v\StackOverflow.xml" $FPS=[xml](Get-Content $Path); # Loops through each employee in the FPS File foreach( $Employee in $FPS.GovTalkMessage.Body.IREnvelope.FullPaymentSubmission.Employee) { # Creates new XML element, sets value to H and then appends at the parent level $LateReason=$FPS.CreateElement("LateReason","http://www.govtalk.gov.uk/taxation/PAYE/RTI/FullPaymentSubmission/15-16/1") $LateReason.set_InnerText("H") $test=$Employee.Employment.Payment.Item('PmtDate'); $Employee.Employment.Payment.InsertAfter($LateReason, $test); } 与java一起使用。我使用的IDE是NetBeans。对于libpd,我使用的是these binary builds for Java。 运行代码时,我得到一个java.lang.UnsatisfiedLinkError。在某些方面,它说:

  

找不到依赖库

我见过针对Android的类似问题,但不适用于Java。

编辑:这是完整的错误消息:

  

线程“main”中的异常java.lang.UnsatisfiedLinkError:   C:\ Users \用户jaiserpe \应用程序数据\本地的\ Temp \ pdnative7141399841793639340.dll:   无法找到依赖库   java.lang.ClassLoader $ NativeLibrary.load(Native Method)at   java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)at   java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)at   java.lang.Runtime.load0(Runtime.java:809)at   java.lang.System.load(System.java:1086)at   org.puredata.core.NativeLoader.loadLibraryFromJar(NativeLoader.java:121)     在org.puredata.core.NativeLoader.loadLibrary(NativeLoader.java:97)     在org.puredata.core.PdBase。(PdBase.java:59)at   holamundo.HolaMundo.main(HolaMundo.java:26)   C:\ Users \用户jaiserpe \应用程序数据\本地\的NetBeans \缓存\ 8.1 \执行人-片段\ run.xml:53:   Java返回:1 BUILD FAILED(总时间:0秒)

2 个答案:

答案 0 :(得分:1)

您似乎缺少float deltaX = Math.abs(event.getX()-otherPoint.getX()); float deltaY = Math.abs(event.getY()-otherPoint.getY()); if(Math.max(deltaX , deltaY) == deltaX){ // touched rather to left or to right of the otherPoint }else{ // touched rather below or above the otherPoint } 的依赖库。

您可以使用DepndencyWalker来检查遗漏的内容。

如果您认为所有必需的库都在那里,请确保它们对JVM可见以便加载。有关在Windows here上加载DLL的更多信息。

答案 1 :(得分:1)

这些DLL是使用MinGW构建的。使用此处的技术http://comments.gmane.org/gmane.comp.gnu.mingw.user/38834,这些构建所需的DLL是:

$ x86_64-w64-mingw32-objdump --all-headers java-build/org/puredata/core/natives/windows/x86_64/pthreadGC2.dll | grep 'DLL Name'
    DLL Name: KERNEL32.dll
    DLL Name: msvcrt.dll
    DLL Name: WS2_32.dll
$ x86_64-w64-mingw32-objdump --all-headers java-build/org/puredata/core/natives/windows/x86_64/pdnative.dll | grep 'DLL Name'
    DLL Name: ADVAPI32.dll
    DLL Name: KERNEL32.dll
    DLL Name: msvcrt.dll
    DLL Name: msvcrt.dll
    DLL Name: pthreadGC2.dll
    DLL Name: WS2_32.dll
$ x86_64-w64-mingw32-objdump --all-headers java-build/org/puredata/core/natives/windows/x86/pdnative.dll | grep 'DLL Name'
    DLL Name: ADVAPI32.dll
    DLL Name: KERNEL32.dll
    DLL Name: msvcrt.dll
    DLL Name: msvcrt.dll
    DLL Name: pthreadGC2.dll
    DLL Name: WS2_32.dll
$ x86_64-w64-mingw32-objdump --all-headers java-build/org/puredata/core/natives/windows/x86/pthreadGC2.dll | grep 'DLL Name'
    DLL Name: KERNEL32.dll
    DLL Name: msvcrt.dll
    DLL Name: WS2_32.dll

如果在系统上找不到所有这些依赖项,或者只是过时,那么重新编译DLL可能对你有用。

祝你好运。