is there any way to interop c++ to native ? i trie...
# kotlin-native
s
is there any way to interop c++ to native ? i tried to use
wx
but I got class error 😂😂😂😂
Copy code
Exception in thread "main" java.lang.Error: /usr/local/include/wx-3.1/wx/buffer.h:19:1: error: unknown type name `class'
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1003)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:992)
	at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:91)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:266)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:72)
	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:37)

> Task :cinteropInteropNative FAILED
If you're wondering how
wx.def
looks line 🤭
Copy code
package = wx
headers.linux = /usr/local/include/wx-3.1/wx/wx.h
linkerOpts.linux =  -static-libgcc  -static-libstdc++ -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu/ -L/usr/local/lib -pthread   /usr/local/lib/libwx_gtk3u_core-3.1.a /usr/local/lib/libwx_baseu-3.1.a -lgthread-2.0 -pthread -lX11 -lXxf86vm -lSM -lgtk-3 -lgdk-3 -lpangocairo-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lXtst -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lwxtiff-3.1 -lwxregexu-3.1 -lwxscintilla-3.1 -lexpat -lpng -ljpeg -lz -ldl -lm
compilerOpts.linux = -I/usr/local/include/ -I/usr/include/ -I/usr/local/include/wx-3.1/ -I/usr/local/include/wx-3.1/wx/ -I//usr/local/lib/wx/include/gtk3-unicode-static-3.1/
m
Not directly no. You'd have to find or create a C API out of the C++ API
k
C shim is the way
❤️ 1