How do I use cinterop on windows? ```headers = Pyt...
# kotlin-native
m
How do I use cinterop on windows?
Copy code
headers = Python.h
package = python
compilerOpts.windows = /I 'C:\\Program Files\\Python39\\Include'

# ignore this one, it's autogenerated from python sysconfig
compilerOpts.linux = -I'C:\\Program Files\\Python39\\Include'
linkerOpts.linux = -L/usr/lib -l python3

---

struct KtPyObject {
    PyObject base;
    void* ktObject;
};
I tried this but I get
Copy code
Exception in thread "main" java.lang.Error: C:\Users\martm\AppData\Local\Temp\1630593588999760275.c:1:10: fatal error: 'Python.h' file not found
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:192)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1189)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1178)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1174)
	at org.jetbrains.kotlin.native.interop.gen.jvm.DefaultPlugin.buildNativeIndex(Plugins.kt:31)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:272)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
h
Just a simple test: try lowercase file name
m
Same error. The file is also called Python.h in the path specified.
h
Are you sure, its called
windows
and not
mingw_x64
?
m
changing it to mingw_x64 also didn't fix it
I also tried converting the flags from msvc to gcc but no success so far
h
Sorry, I dont use windows/cinterop in detail, I can't help you 😐
m
looks like I had to use double quotes