Hi guys, can I use a library built in C++ with Kot...
# kotlin-native
s
Hi guys, can I use a library built in C++ with Kotlin Native? If not, what is the technical problems that make this not possible?
k
you will have to create a shim in C
s
Do yu have any resource of how do that? like sample project?
k
i do not
c
The main problem is that the code generated by C++ with name mangling, inlining, memory management and templates, it's handling of this makes it a challenge to describe the C++ to the Kotlin compiler. With C Interop you are calling functions with names and arguments. You will need to create a wrapper that represents the C++ as a collection of C functions.