Hello everyone! :slightly_smiling_face: Happy to b...
# kotlin-native
a
Hello everyone! ๐Ÿ™‚ Happy to be here and to (hopefully) help push Kotlin/Native forward a little more! Right with my first post, i need to ask for some help with the CInterop tooling. I already opened a ticket for this but maybe some of you on here already know a thing or two that i don't. I'm having trouble using my own Kotlin lib which in turn uses a static C library on macOS. However, this static C library depends on some mac frameworks. This requires the frameworks to be specified before the actual C library on the linker CLI, however after checking the CInterop implementation, additional linker args from the buildscript are always inserted after the linker opts and libs specified by the .def file. Any help or guesses are appreciated at this point ๐Ÿ™‚ EDIT: I found the issue. For some reason, using a backslash to escape newlines in the .def file works fine within the same project, but not when the library is consumed.. I am baffled.
o
I'm not an expert in how macos frameworks are linked, but I've stumbled recently on it a bit and the following works for sure sorry, I'm not a K/N expert for sure, but for me the problem is not fully clear, probably because it's hard to see the full configuration which works (even with absolute paths) or doesn't work - so I'm mostly speculating ๐Ÿ™‚
๐Ÿ‘€ 1
a
Thanks for the idea! ๐Ÿ™‚ I already tried this sadly, but with a different platform-filter (which seems to be recognized fine). The issue for me is not building the library (which in returns links to the C-lib), but consuming the produced library in a Kotlin/Native executable because it can't resolve the static C lib outside the Kotlin lib project.. It's a very specific edge case.
This solution worked for me ๐Ÿ™‚ Looks really ugly with the mismatched os family names but that's the way it works rn.
๐Ÿ‘ 1