Hi everyone, I have generated .dll using kotlin na...
# kotlin-native
m
Hi everyone, I have generated .dll using kotlin native for windows. I am able to access the functions from windows c++ console app as well(voila!) but I am not able to do the same for a c# windows app. [DllImport("libnative.dll", SetLastError = true)] public static extern void libnative_symbols()->kotlin.root.packagename.main(); I was able to call libnative_symbols()->kotlin.root.packagename.main(); from c++ windows console app but I am not able to call if from a c# app. could anyone redirect me to any example or resource?
r
IIRC, you basically have nested structures called kotlin, root, packagename, and last one would have function pointer called main. Try to map this hierarchy to C# and get your main out of the inner structure. (I may be mistaken, didn't touch reverse C interop for a while)
m
yeah I got https://github.com/diteix/kotlin-native-import it suggests how I can use dynamic libraries generated from kotlin native in c#