I would like to use the Kotlin REPL to interact with C libraries. My understanding is that Kotlin/Native ships with a tool called cinterop
that can generate bindings both for the JVM and for native compilation.
Executing cinterop
with no arguments shows that the default flavor is jvm
. So I executed
cintertop -def=libcurl.def
and obtained the file nativelib-build\kotlin\libcurl\libcurl.kt
.
Then I tried to compile this file using kotlinc
(the one bundled with Kotlin not with Kotlin/Native) and the compilation failed with lots of unresolved references to the kotlinx, cnames and platform packages.
How can I compile the cinterop-generated bindings in order to use them in a Kotlin JVM program?