sdeleuze
02/15/2022, 8:42 AMimport platform.posix.*
and import libcurl.*
in red (unresolved reference) in kotlin/kotlin-native/tools/benchmarksAnalyzer/src/main/kotlin-native/org/jetbrains/analyzer/Utils.kt
.
I found in Kotlin Native README that I had to run ./gradlew :kotlin-native:dist :kotlin-native:distPlatformLibs
at the root of the kotlin
project to get import platform.posix.*
resolving. This part is now fixed.
But I am blocked for libcurl:
> Task :compileNativeMainKotlinMetadata FAILED
e: /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/src/main/kotlin-native/org/jetbrains/analyzer/Utils.kt: (10, 8): Unresolved reference: libcurl
I have libcurl installed (Archlinux) and headers are in /usr/local/include
.
I tried to modify the build to specify `compilerOpts '-I/usr/local/include'`:
fromPreset(presets.linuxX64, 'linux') {
compilations.main.cinterops {
libcurl {
compilerOpts '-I/usr/local/include'
includeDirs.headerFilterOnly '/usr/include', '/usr/local/include'
}
}
}
But still the same error. When I try to build the project with gradle build
I get:
> Task :compileNativeMainKotlinMetadata FAILED
e: /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/src/main/kotlin-native/org/jetbrains/analyzer/Utils.kt: (10, 8): Unresolved reference: libcurl
The command gradle cinteropLibcurlLinux
seems to run properly and invokes cinterop -o /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/build/classes/kotlin/linux/main/cinterop/benchmarksAnalyzer-cinterop-libcurl.klib -target linux_x64 -def /home/seb/playground/kotlin/kotlin-native/tools/benchmarksAnalyzer/src/nativeInterop/cinterop/libcurl.def -compiler-option -I/usr/local/include -Xmodule-name benchmarksAnalyzer-cinterop-libcurl
which seems to work fine.
Could somebody point me to what I am missing to get libcurl resolving both in IDEA and with gradle build
?Artyom Degtyarev [JB]
02/15/2022, 8:48 AMElena Lepilkina
02/15/2022, 9:00 AMkotlin.mpp.hierarchicalStructureSupport=false
(in same file).
Sorry for inconvenient state of this app in master branch, this will be fixed soongradlew build --continue
will produce native executablessdeleuze
02/15/2022, 9:14 AMkotlin.mpp.hierarchicalStructureSupport=false
made the trick, thanks!napperley
02/15/2022, 10:15 PMElena Lepilkina
02/16/2022, 6:43 AMkotlin.mpp.enableCInteropCommonization=true
in this case. This is case of master branch and features are enabling step by step.