Can Kotlin Native cinterop work with a C++ library...
# kotlin-native
n
Can Kotlin Native cinterop work with a C++ library whose only public functions are marked as
extern "C"
?
d
Yes but you still need a C header for it I think.
n
Thanks Dominic! The lib has several C++ headers, but the one that matters (the lib API surface) has only
extern "C"
functions. Do you think I should pass this main header to cinterop, or write another, or what? This header of course includes the other C++ headers of the library - not sure if this would create issues.
d
I think you should write another header, it'll most be copy and paste, or maybe even some macros. There may a tool that can do this for ya.
n
That worked, thank you!