When it comes to using cinterop with pure-header l...
# kotlin-native
j
When it comes to using cinterop with pure-header libraries like stb_image.h, do I need to make a file like placeholder.c that just includes the header? Or can I just do #include in the interop.def file? I've run into some problems on both, so I'm not sure which obstacle I should try to surmount.
o
You don’t need to create anything to interop with such libs, for example
Copy code
cinterop -h stb_image.h -compilerOpts "-I. -DSTB_IMAGE_IMPLEMENTATION=1" -pkg stb_image
produces
nativelib.klib
, you can examine its contents with
klib contents nativelib.klib
j
Much obliged.