Just found a weird error with cinterop on OSX.
# kotlin-native
i
Just found a weird error with cinterop on OSX.
a
Have you declared the path to gsl/gsl_blas.h ? It looks like Kotlin compler cannot find it. Could you show me your *.def file and cinterop block in build.gradle.kts? see also: https://kotlinlang.org/docs/reference/native/gradle_plugin.html#cinterop-support
a
I haven’t understood what you want, but if I were you I would not use
headerFilterOnly("/usr/include/", "/usr/local/")
and
headerFilter=gsl/**
the same time.
i
The headers on OSX are installed to /usr/local/gsl/...
a
May be use
compilerOpts = -I /usr/local/gsl
?
i
So, compilerOpts property is equal to includeDirs?
a
If the header
gsl_blas.h
locates at
/usr/include/gsl/gsl_blas.h
,
compilerOpts
must be
-I/usr/include
, not
-I/usr/include/gsl
.
-I
parameter in
compilerOpts
is equal to
includeDirs
in
build.gradle.kts
.
kmath-gsl/build.gradle.kts
Copy code
val libgsl by creating {
    includeDirs {
        defFile = File(projectDir, "src/nativeInterop/cinterop/libgsl.def")
    }
}
i
Oh, thank you