Comments (2)
Hello!
We're not responsible for this. Please, create an issue in Kotlin tracker..
And feel free to reopen this issue if you have any questions.
from compose-multiplatform.
@wooram-yang I know it's closed, but you're not compiling and linking Sampleinterop.c
. You must compile it into a .a
file (using Clang or any other equivalent C toolchain) and put it into cinterop
like the following.
headers = Samplecinterop.h
staticLibraries = libsamplecinterop.a
The package
property in cinterop .def
files means the Kotlin package name of the generated .klib
file.
To automate that, you can make a C compiling task and make tasks.named(cinterop.interopProcessingTaskName)
depend on that task. This just briefly explains how to do it, so you have to implement your own tasks and carefully set dependencies between the tasks.
kotlin.targets.withType(KotlinNativeTarget::class) {
val cCompilingTask = tasks.register("compileCFor{name}") {
doLast {
project.exec {
commandArgs("clang", "-c", "samplecinterop.c", "-o", "samplecinterop.o")
}
project.exec {
commandArgs("ar", "r", "libsamplecinterop.a", "samplecinterop.o")
}
}
}
compilation.getByName("main") {
cinterops.register("your cinterop name") {
tasks.named(interopProcessingTaskName).dependsOn(cCompilingTask)
}
}
}
If you think authoring custom tasks is too much for your use case, I suggest you just to embed the function definitions to the header with static inline
. You can see an example in here.
from compose-multiplatform.
Related Issues (20)
- Resources (files) are not packed in SPM for native targets HOT 3
- Empty Material 3 TextField with label jumps when it gets focus
- stringResource filters the default when getting the resource path HOT 5
- Compose Multiplatform string resources: only accepting "strings.xml" HOT 4
- Cannot make undecorated window fullscreen
- Make resize area larger or configurable for undecorated windows HOT 9
- Identical naming of compose.components.* jars breaks packaging with Conveyor
- MACOS signing java.nio.file.NoSuchFileException: picking
- IllegalArgumentException when re-show a disposed ComposeWindow HOT 12
- Compose Multiplatform support for Mac OS native apps HOT 6
- Resource Gradle task regression with other generated tasks HOT 1
- Setting minimumSystemVersion for macOS not possible HOT 1
- first element in dropdown does not have a hitbox in iOS accessibility HOT 2
- Kotlin `object` is null: incorrect static initialization HOT 7
- Hello! How to format decimal values using only Kotlin classes HOT 1
- UIKitVIew with MKMapView subview crashes with kotlin.IllegalStateException: Size is out of range. HOT 1
- DialogWindow throw the exception when showing - Jetpack Compose desktop HOT 19
- iOS 17 hidden trackpad doesn't work in the TextFields (hold space bar and swipe to move cursor) HOT 2
- Drop frames when scrolling on iOS (only smooth when start screen recording) HOT 1
- API Reference for Compose Multiplatform's Composable Functions? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-multiplatform.