Hi. getting started with K/N. Trying to create an ...
# kotlin-native
j
Hi. getting started with K/N. Trying to create an interop lib for libFUSE. Def file:
Copy code
headers fuse3/fuse_lowlevel.h
compilerOpts = -lfuse3
when i run cinterop as such:
Copy code
cinterop -def libfuse.def -copt -I/usr/include -o libfuse
I get this error:
Copy code
Exception in thread "main" java.lang.Error: /usr/include/fuse3/fuse_lowlevel.h:22:2: error: FUSE_USE_VERSION not defined
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:137)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:898)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:888)
	at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:56)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:307)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:38)
	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:100)
	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:29)
This is normal when a
Copy code
#define FUSE_USE_VERSION 31
does not appear before the header is included. Is there anyway I can do this? I tried adding the
Copy code
---
and putting the define after that, but the docs indicate that this is for adding stuff AFTER the headers have been processed. Is there a way to add something before the headers?
v
try adding something like
-DFUSE_USE_VERSION=31
to
compilerOpts
j
ha! 😄 that worked, thanks