LiveSplit / livesplit-core

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.
https://livesplit.org/
Apache License 2.0
209 stars 57 forks source link

Use with JNI #520

Open BRQuad opened 2 years ago

BRQuad commented 2 years ago

How you use livesplit-core with JNI on Linux ?

File system : /lib/livesplitcore/livesplitcore.so Java file : System.loadLibrary("livesplitcore") (static) in LiveSplitCoreNative.java IntelliJ : livesplitcore library in /lib/livesplitcore + livesplitcore library dependancy in the project module Java option : -Djava.library.path=/lib/livesplitcore

And finally i have an error : UnsatisfiedLinkError: no livesplitcore in java.library.path

I have used the livesplit-core-v0.12.0-x86_64-linux-android.tar.gz file. Does the .h and .cpp files are necessary ? And have the same name ?

kadiwa4 commented 2 years ago

I think you need to rename the library file to liblivesplitcore.so. Don't change the line System.loadLibrary("livesplitcore").

BRQuad commented 2 years ago

It was the solution, thank you. But unfortunately i have an new error, and i am not sure of be able to do something : UnsatisfiedLinkError : /lib/livesplitcore/liblivesplitcore.so: /lib/x86_64-linux-gnu/libc.so: invalid ELF header

BRQuad commented 2 years ago

With the x86_64-unknown-linux-gnu package i obtain an other error : UnsatisfiedLinkError : long LiveSplitCoreNative.Run_new()

Otherwise the Run::parse(String, String, boolean) method call the inexistant LiveSplitCoreNative::Run_parseString(String, String, boolean) method.