C interop


Hello. Tried to build a simple kotlin example with interop using libcurl. I did everything by example. When compiling does not find the imported functions.
When trying to use this https://jonnyzzz.com/blog/2018/05/28/minimalistic-kn/ example, the same problem was released(“main.kt:3:15: error: unresolved reference: foo
val z = lib.foo()”)
kotlin native 1.3.11
Windows 10 64bit

Kotlin c interop.7z (6.3 KB)


How did you compile lib.c ?
On Windows it must be compiled by msys2-mingw64.


Compiled “gcc” installed in kotlin / native


Works for me: kotlin_c_interop.zip (1.2 KB)


Your example works. Thanks you. I registered all the paths and as in the bat file and everything now works.
There is another question for you if I can use dll from delphi if I write ‘.h’ and 'to them. lib '. And will it be possible to connect dll without header files, such as in python?