Hello, How can we consume .c or .h or .a files in ...
# multiplatform
u
Hello, How can we consume .c or .h or .a files in Common code in kotlin multiplatform and do some File IO and publish it to IOS and Android ?
j
You would have to expect/actual them for use in common. On Kotlin/Jvm you can use JNI. On Kotlin/Native you can use cinterop. On JS you can use things like emscripten or even bind to WASM.
You can look at https://github.com/cashapp/zipline for an example of using a native library in Kotlin/Jvm and Kotlin/Native. This is the type that we bind across JVM and native https://github.com/cashapp/zipline/blob/trunk/zipline/src/engineMain/kotlin/app/cash/zipline/QuickJs.kt
u
thanks @jw