38 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Advice
0
votes
0
replies
37
views
Is There an Easier Way to Use Swift Code in Kotlin Multiplatform? Step-by-Step with Cocoapods
Is there any new/easy way to call swift function from kotlin directly in kmp project?
or
Can anyone explain the same using cocoapods step by step?
0
votes
0
answers
30
views
Kotlin KMP native library; how to convert KNativePtr to typed c array like int *?
Im creating a KMP library for JVM and native linuxX86. I want to call the generated native library from a C program.
The header that gets generated in libnetchdf_api.h looks in part like this:
typedef ...
1
vote
0
answers
141
views
SwiftKlib plugin fails: cinterop... .klib does not exist – how to resolve?
I'm using the SwiftKlib Gradle Plugin in my Kotlin Multiplatform Mobile (KMM) project to call Swift code from Kotlin/Native.
When i click sync i get errors like this:
Failed to generate cinterop for :...
1
vote
1
answer
210
views
Rust and Kotlin/Native interop using gradle
Recently, I have been trying to create a simple Kotlin/Native program that can use a Rust defined function.
I am using the Kotlin Multiplatform plugin in Gradle to try to acieve this. I have created a ...
1
vote
1
answer
452
views
KMP cinterop swiftklib not resolved
I’m new to Kotlin Multiplatform for Android and iOS.
I’m trying to use a custom Swift Class I created in Kotlin Class. After doing some research, I found that it can be done using cinterop, and it’s ...
0
votes
2
answers
141
views
Interporating with C embedded struct ("inheritance") in C++
I'm working on a C++ program depends on a C library that uses the "struct embedding" trick to simulate inheritance (of data storage, not behaviour), similar to the Parent and Child structs ...
0
votes
1
answer
143
views
Kotlin Multiplatform objective-c export file name convention
What logic is used to create class and protocol names when Kotlin code is exported to Objective-C? Additionally, where can I find detailed information about this process?
Where code like:
package ...
0
votes
1
answer
130
views
How to convert a List or Array to C Array in Kotlin/Native
Given an array Array<VkDeviceQueueCreateInfo> I want to convert it to a C Array of C values (or pointer to the first item), i. e. VkDeviceQueueCreateInfo*.
This is where I'm getting a type ...
0
votes
1
answer
47
views
How to convert CValues to List in Kotlin/Native (or iterate)?
I have a CValues<VkLayerProperties> which is passed to a C function so that it can fill the array.
val layerProperties = createValues<VkLayerProperties>(layerCount.value.toInt()) {}
...
0
votes
1
answer
115
views
Kotlin/Native Cinterop With libxml2 - Corrupted XPath Expression
Versions
Kotlin 1.9.22
libxml 2.9.14+dfsg-1.3
OS: Ubuntu 23.10
The Problem
In a small Kotlin/Native application I use cinterop with libxml2 to evaluate a set of XPath expressions to extract element ...
0
votes
1
answer
161
views
How do you define a =copy hook for a distinct-cstring-type in nim?
For interacting with the GTK library I call some functions that hand me a c-string (char*) that my code owns going forward.
I want to have those strings in a custom distinct cstring type and define a =...
1
vote
0
answers
37
views
In Kotlin Multiplatform, using gradle.kts, how do I determine the compilers used for targets like linuxX64, mingwX64, and mac/ios?
I need to know what compilers are being used so I can compile my C++ code with them.
I tried using the standard host compilers (for when the target == my host) and it did not work due to undefined ...
2
votes
2
answers
168
views
Access tuple (defined by libc) using an index
I understand that Swift tuples cannot be indexed at runtime. However, I'm working with the POSIX terminal interface (defined by <termios.h>, which is part of libc).
In the C code, we are able to ...
2
votes
1
answer
186
views
How to send a `vararg variadicArguments: kotlin.Any?` to a GObject native call with Kotlin Native?
I'm working on a GIR generator to create Kotlin Native bindings for GTK and other GObject based libraries. I reached a stage where I can almost compile the bindings for GLib but I'm stuck with the ...
1
vote
1
answer
503
views
How can I build a libcurl Kotlin Native application on Windows?
I'm relatively new to Kotlin Native, and to learn more about it, I am studying these two tutorials, one from the official JetBrains documentation and the other from the jonnyzzz blog, both focused on ...