Interoperability with C

Edit pageLast modified: 11 February 2025

This document covers general aspects of Kotlin's interoperability with C. Kotlin/Native comes with a cinterop tool, which you can use to quickly generate everything you need to interact with an external C library.

The tool analyzes C headers and produces a straightforward mapping of C types, functions, and constants into Kotlin. The generated stubs then can be imported into an IDE to enable code completion and navigation.