Has anyone successfully linked a rust static libra...
# kotlin-native
c
Has anyone successfully linked a rust static library to a kotlin mingwx64 target?
y
Yes, I managed to do it in this project. https://github.com/smyrgeorge/sqlx4k To be honest never tested on windows, but still though the compilation succeeded
c
When building sqlx4k on windows, linking fails for executable targets.
Copy code
.../clang++ command returned non-zero exit code: 1.
output:
lld-link: warning: ignoring unknown argument: -exclude-symbols:___chkstk_ms
lld-link: error: -exclude-symbols:___chkstk_ms is not allowed in .drectve
lld-link: warning: ignoring unknown argument: -exclude-symbols:__floattidf
lld-link: error: -exclude-symbols:__floattidf is not allowed in .drectve
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
y
Perhaps is due to the old llvm version (11). The next upcoming kotlin release 2.1.0 maybe will resolve this issue. They changed the llvm version to 16. Take a try using koltin
2.1.0-Beta1
. Here is the release notes: https://kotlinlang.org/docs/whatsnew-eap.html#update-llvm-version-to-16-0-0-for-kotlin-native
c
It still doesn't work. Maybe windows needs dynamic linking...