Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundled library not found #115

Open
MFAshby opened this issue Jan 12, 2018 · 1 comment
Open

Bundled library not found #115

MFAshby opened this issue Jan 12, 2018 · 1 comment

Comments

@MFAshby
Copy link

MFAshby commented Jan 12, 2018

I have used JNAerator to produce java bindings for a shared library using the corresponding headers. The generated code can't find the native library at runtime. (I get UnsatisfiedLinkError)

I used the following options to generate the bindings:
$JNAERATOR -mode StandaloneJar -runtime JNA -forceStringSignatures -beanStructs -beautifyNames deezer.h Linux/x86_64/libdeezer.so -jar ../lib/deezer.jar

In the jar that was produced, the library file was put in the following location:
lib/linux_x64/libdeezer.so

However, debugging the problem I can see that when the code searches for the library in resources, it looks in the following location:
x86_64-linux-gnu/libdeezer.so

See com.sun.jna.Native#extractFromResourcePath(...)

This makes the generated standalone jar useless!

@MFAshby
Copy link
Author

MFAshby commented Jan 12, 2018

Offending code that packages it in the wrong place:
com.ochafik.lang.jnaerator.JNAerator#getResourceFiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant