Beginner question... Can anyone point me to an exa...
# kotlin-native
n
Beginner question... Can anyone point me to an example of linking/calling a rust dynamic library from a kotlin native application? I'm expecting some kind of c interop, but the lack of header files in the rust works leaves me a bit puzzled. This is purely for experimental purposes, not for any real world problem.
t
make header files for Rust as you would for C
n
ok...spent much longer than I care to admit trying to solve this. After much experimentation, I create a "C" based header file, and managed to come up with a def file that sort of works...except at build time:
Copy code
The /home/nheitz/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold command returned non-zero exit code: 1.
output:
/home/nheitz/CLionProjects/first-interop/target/release/libfirst_interop.so: error: undefined reference to 'lstat64', version 'GLIBC_2.33'
/home/nheitz/CLionProjects/first-interop/target/release/libfirst_interop.so: error: undefined reference to 'pthread_getattr_np', version 'GLIBC_2.32'
/home/nheitz/CLionProjects/first-interop/target/release/libfirst_interop.so: error: undefined reference to 'stat64', version 'GLIBC_2.33'
/home/nheitz/CLionProjects/first-interop/target/release/libfirst_interop.so: error: undefined reference to 'fstatat64', version 'GLIBC_2.33'
/home/nheitz/CLionProjects/first-interop/target/release/libfirst_interop.so: error: undefined reference to 'fstat64', version 'GLIBC_2.33'
/home/nheitz/CLionProjects/first-interop/target/release/libfirst_interop.so: error: undefined reference to 'pthread_sigmask', version 'GLIBC_2.32'
My trivial .so object references glibc "stuff" that the kotlin linker just doesn't see. Any suggestions?