Is it possible to use a C++ library from a kotlin multiplatform mobile app?

Viewed 689
1 Answers

You cannot directly interop with C++ from Kotlin/Native (using cinterop). Your C++ library would need to expose an extern C version of itself, or you'd need to create a C compatible bridge to your C++ library, and let cinterop look at that.

It might be more natural to wrap that with an Objective-C interface rather than a C one, but that will obviously depend on what the library does and your comfort level with C vs Objective-C.

Related