Hello, what is the IDE I can use for development o...
# kotlin-native
m
Hello, what is the IDE I can use for development of kotlin/native application with some code in C / C++? Should I use CLion or IntelliJ? Also what version?
l
kotlin/native is gradle based, and will work with the two IDEs but a bit better with IntelliJ with the lastest EAP versions
n
Kotlin Native with IntelliJ (incl Community Edition) is only supported in the recent EAP versions.
m
I installed the EAP version, but the build.gradle file is different than it used to be. Is there any documentation how to configure interop() artifacts (for integration with C)?
n
Have a look at this document (only covers the new unstable plugin which isn't Gradle Kotlin DSL compatible ☹️): https://github.com/JetBrains/kotlin-native/blob/master/GRADLE_PLUGIN.md
m
Thank you for the link, however now I have problem when I try to use C library from Kotlin. I downloaded LZ4 from github, built it as static library, then created
.def
file:
Copy code
headers = C:\\temp\\kotlin_tests\\interop\\lz4\\lib\\lz4.h
package = lz4
staticLibraries = liblz4.a
libraryPaths = C:\\temp\\kotlin_tests\\interop\\lz4\\contrib\\cmake_unofficial\\cmake-build-debug
but when I try to build application with call to library I get this strange linker? error:
Copy code
> Task :compileDebugKotlinNative
C:\Users\Matej\AppData\Local\Temp\konan_temp5398659378648080731\combined.o:(.text+0x242f5): undefined reference to `LZ4_versionNumber'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
error: c:\Users\Matej\.konan\dependencies\msys2-mingw-w64-x86_64-gcc-7.3.0-clang-llvm-lld-6.0.1/bin/clang++ invocation reported errors
Any idea, how to configure it correctly?
Nevermind, the LZ4 library I had was 32bit, while the kotlin build was 64bit - that's why the linking error appeared. The only problem I have now is that my IntelliJ doesn't recognize .kt files as kotlin source files, nor does it recognize the interop library.