https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
a

axeon

03/23/2024, 8:58 AM
hello there, is it possible to define a C struct in Kotlin Native? (for later export to a dll)
l

Landry Norris

03/23/2024, 6:37 PM
The best way would be to define the struct in a def file and use cinterop. If your library provides a header with the struct definition, you can tell cinterop where to find it, otherwise, you can place the struct definition after the three dashes at the end of the def file.
👍 1
2 Views