Hi! I am not sure this is the right place but I am looking for some help to shed light on a error upon which I spent more than a week on Windows.
I am writing a Kotlin Multiplatform wrapper for
google/leveldb. For some links:
-
leveldb-builds: where the binaries are compiled for Linux, Windows, Apple and Android targets (arm32, arm64, x64, shared and static)
-
kotlin-leveldb: the repository where I use JNA
For the Kotlin/JVM and Android part I am using JNA. The JVM implementation is shared between Android and desktop using the Gradle KMP plugin. The tests are also shared. All tests passes, but for Windows x64 (I haven't yet tested Windows arm64).
In particular, the error in question is (sorry for the Italian):
_______________________________________
UnsatisfiedLinkError: The specified procedure could not be found
INFORMAZIONI: Found library resource at jar:file:/C:/Users/lamba/IdeaProjects/kotlin-leveldb/build/libs/kotlin-leveldb-jvm-1.0-SNAPSHOT.jar!/win32-x86-64/leveldb.dll
nov 13, 2024 11:43:04 PM com.sun.jna.Native extractFromResourcePath
INFORMAZIONI: Extracting library to C:\Users\lamba\AppData\Local\Temp\jna-102737879\jna900937333738511061.dll
Exception in thread "main" java.lang.UnsatisfiedLinkError: Impossibile trovare la procedura specificata.
_______________________________
Not another detail. I of course made many attempts to try to figure out what was going on:
-
nm -g .\leveldb.dll | findstr "leveldb_": all symbols are there, perfect names, no magnling
- I linked the C++ standard library statically in the dll
- loaded manually the library using `NativeLibrary.getInstance`
I am not really an expert in native compilations, and at this point I am really out of ideas. The strange part is that on other OS/archs it works perfectly, you can see it in the
tests.
I am out of ideas on how to fix this one. Does someone have encountered a similar issue?