Sorry if this is a dumb question, I'm trying to us...
# kotlin-native
w
Sorry if this is a dumb question, I'm trying to use a library on windows that only has a header and dll built in the msvc toolchain, but I figured as long as it just exported normal c bindings, I might still be able to cinterop the header, gen a link library for mingw, and link in kotlin native that way. When I run cinterop on the header though, it tries to use headers not present in the mingwx64 win32 headers, specifically EventToken.h which appears to be a winrt file. I attempted to add the include directory of my locally installed windows sdk for the msvc toolchain in C:\Program Files (x86)\Windows Kits\10\Include\*\winrt, but that tries to include winnt.h at some point, which fails with
Copy code
Exception in thread "main" java.lang.Error: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h:173:2: error: "No Target Architecture"
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:328)
Which I'm assuming is because mingw doesn't play nice with the windows sdk. Does anyone have any ideas or is this just a fools errand?
1
Also, the excludeFilter appears to just not be working? I tried adding excludeFilter=EventToken.h to the def file, it highlights "excludeFilter" red and still attempts to look for EventToken.h
probably doesn't help anybody else, but I resolved this by just copying EventToken.h out of the windows sdk into my project. All the includes it required were available in the mingwx64 and it otherwise worked fine. I converted the lib file to a .a and was able to link to the DLL just fine. crappy solution, but it works.