I am trying to link to a C library in my program I...
# kotlin-native
m
I am trying to link to a C library in my program I am cross-compiling, I have compiled a
.so
library on my target, and copied it back to my development box. I can use library functions and the project compiles, but it fails at linking with:
.[..]/.konan/dependencies/arm-unknown-linux-gnueabihf-gcc-8.3.0-glibc-2.19-kernel-4.9-2/arm-unknown-linux-gnueabihf/bin/ld.bfd: src/nativeInterop/cinterop/libpigpio.so: undefined reference to glob@GLIBC_2.27'
It looks like Kotlin/Native is trying to compile with a different version of glibc than I compiled the library with, and it doesn't work. But how do I choose the glibc version in my project?
👀 1
✅ 1
The old version of glibc in the Kotlin/Native compiler can't be updated: https://youtrack.jetbrains.com/issue/KT-47061 Instead, I had to compile my library in a Docker container with an old version of the OS, where the glibc version is old enough to be compatible with the K/N one. That solved my issue.