William Reed

05/04/2023, 5:15 PM
i have a multiplatform module with native code to take advantage of an existing library written in C. I want to write my main code in kotlin/jvm to take advantage of the jvm offerings. what is the correct way to set this up with my modules? so far I have 1. jvm module for my application code 2. mutliplatform module which has my native code For 2 do I need to expose a common src dir which exposes the native code with expect/actual? or am i mistaken that 1 can be a kotlin/jvm module and it also needs to be kotlin/multiplatform?
i think i misunderstood thinking i could call kotlin/native from kotlin/jvm. disregard this 🙂

Landry Norris

05/04/2023, 6:45 PM
You can use JNI/JNA to call into native code from K/JVM. You'd have to write the bindings.

William Reed

05/04/2023, 6:46 PM
Unfortunately the work outweighs the benefit for my case. Thanks!