https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotlin-native
  • m

    Matthew Murray

    08/04/2022, 9:26 PM
    👋 Since using KMM to compile a shared module, my XCFramework size has ballooned from 13 to 99 MB. I know that on the Android side we have R8 and progaurd to minify and remove unused code from dependencies. Does anything like that exist on the iOS/Mac side? Or what tools are available to prune the size of the KMM objc frameworks?
    h
    r
    • 3
    • 9
  • n

    natario1

    08/05/2022, 2:47 PM
    Does String.hashCode return the same value on JVM and native? It seems that both use the same polynomial hash implementation. Maybe it was a conscious design decision and one could rely on it?
    r
    • 2
    • 4
  • b

    brabo-hi

    08/05/2022, 7:09 PM
    Hello guys, i am calling suspend function on ios, and is getting the following error,
    *Calling Kotlin suspend functions from Swift/Objective-C is currently supported only on main thread*
    any clue
    h
    • 2
    • 2
  • n

    napperley

    08/08/2022, 2:57 AM
    Which performance metrics would be relevant to a K/N program (that targets Linux for example) that uses the new K/N memory model?
  • p

    p4czyk

    08/08/2022, 7:03 PM
    Hey guys! 😊 Do you know how I can compile a
    kotlinx
    library like
    kotlinx-datetime
    for LinuxArm64 and use it in my project? 🤔
    l
    e
    +2
    • 5
    • 36
  • j

    Joakim Forslund

    08/09/2022, 3:59 PM
    On the off-chance that someone has used directx 11 with kotlin native and mingw for windows, can anyone spot any specific reason to why the following code would not run, given that the ID3D11Device is setup correctly:
    pacman -S mingw-w64-x86_64-headers-git
    
    directx.def
    =======================
    package = directx
    headers = windows.h windowsx.h stdint.h d3dcommon.h d3d11.h winuser.h dxgi.h
    headerFilter = windows.h windowsx.h stdint.h d3dcommon.h d3d11.h winuser.h dxgi.h
    libraryPaths = C:/msys64/mingw64/x86_64-w64-mingw32/lib C:/msys64/mingw64/lib
    linkerOpts =  -LC:/msys64/mingw64/lib -LC:/msys64/mingw64/x86_64-w64-mingw32/lib -ldxguid -ld3d11 -ldxgi -lstdc++ -DUNICODE
    compilerOpts = -LC:/msys64/mingw64/lib -LC:/msys64/mingw64/x86_64-w64-mingw32/lib -ldxguid -ld3d11 -ldxgi -lstdc++ -DUNICODE
    ---
    
    Problematic code:
            val dxgiDevice: IDXGIDevice = alloc()
            println("Device instance: ${D3DDevice.ptr}")
            val vtable = D3DDevice.lpVtbl?.pointed
            println("Trying to make use of virtual table... P: $vtable")
            hr = vtable?.QueryInterface?.invoke(D3DDevice.ptr, IID_IDXGIDevice.ptr, dxgiDevice.ptr.pointed.reinterpret()) ?: 0
            println("3")
            if(FAILED(hr)){
                MessageBoxA(null ,"D3DDevice->QueryInterface failed", null, 0)
            }else{
                println("D3DDevice->QueryInterface success!")
            }
    We never reach println("3"), and I'm not getting any exception reasons or missing imports
  • g

    Goth

    08/09/2022, 7:08 PM
    Any one worked here on kotlin-native kotlin bindings for C/C++ calls? we are seeing return value from C/C++ as null.
    n
    • 2
    • 1
  • s

    spierce7

    08/10/2022, 1:46 AM
    Are there any examples Kotlin native drawing a simple UI in windows or Mac? I was contemplating using Kotlin native as an app that downloads the rest of the app which is much larger. I just need to display some text and a progress bar in Mac and windows UI.
    d
    • 2
    • 7
  • l

    Lei Lei

    08/10/2022, 11:46 PM
    Does anyone know where I can find the source code or documentation about platform libraries, e.g. platform.Foundation.*? I downloaded Kotlin toolchain on Mac, and it seems klib/platform/$target folder contains lots of platform libraries, however I only found
    cstubs.bc
    file insider, can not find any kotlin bindings, does anyone know how to get kotlin bindings for those platform libraries?
    m
    e
    d
    • 4
    • 7
  • l

    Landry Norris

    08/11/2022, 4:46 PM
    Like any programmer, I’m too lazy to go check the charging status of my car, so I’d like to spend time programming a microcontroller to send data it gets from CANBus over LoRa to my desktop, where it can be processed and sent to my phone. Normally, I’d reach for a RasPi pico and Rust, but I’d like to use Kotlin this time. Is zephyr support good enough that I could buy a disco board, or should I go for a RasPi zero and run Kotlin on embedded Linux? I’m a bit concerned about power consumption if I go full embedded Linux.
    n
    m
    l
    • 4
    • 22
  • t

    Tim Ortel

    08/14/2022, 1:10 PM
    How can I get the offset of a variable of a struct in Kotlin? In objective C there is a offsetof(struct, elem) function. Can I access that from Kotlin?
  • d

    Didier Villevalois

    08/14/2022, 2:06 PM
    Hi all! I'm sorry if this questions have already been asked, but I might not use the right search terms... I don't know what I am configuring wrongly but I am failing to have to get filenames and line numbers in my Kotlin/Native stacktraces. (I give an example stacktrace in the thread.) Also, when executing tests with Kotest (might be an issue with Kotest though). You can also see this in CI builds (e.g. https://github.com/ptitjes/kzmq/runs/7826776961?check_suite_focus=true#step:6:418) where filenames are
    null
    and line numbers are `-1`:
    DealerRouterTests.base (cio, cio) FAILED
        kotlinx.coroutines.TimeoutCancellationException at null:-1
    The said stacktrace is produced while running native tests of Kzmq. Note that this project consists of multiple sub-projects (
    :kzmq-core
    ,
    :kzmq-cio
    , ...) and the tests are located in their own sub-project (
    :kzmq-tests
    ).
    s
    s
    • 3
    • 7
  • n

    Nikky

    08/16/2022, 11:10 PM
    i tried to enable libbacktrace via
    kotlin.native.binary.sourceInfoType=libbacktrace
    and it seems to work locally fine on
    macosArm64
    , but when crosscompiling to
    mingw64
    as usual.. stuff starts to break down, both on my macbook and ubuntu CI runner i get
    e: /Users/nikky/.konan/dependencies/apple-llvm-20200714-macos-aarch64-essentials/bin/clang++ invocation reported errors
    
    The /Users/nikky/.konan/dependencies/apple-llvm-20200714-macos-aarch64-essentials/bin/clang++ command returned non-zero exit code: 1.
    output:
    lld-link: error: undefined symbol: Kotlin_getSourceInfo_libbacktrace
    >>> referenced by /var/folders/wp/xphwwgsj3zg4w61bkrh4sdvm0000gn/T/konan_temp18158004099953611372/result.o:(Kotlin_getSourceInfo_Function)
    clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
    
    FAILURE: Build failed with an exception.
    does anyone know what package i might need to install ? or how to configure libbacktrace only for linux and macos targets ?
    s
    • 2
    • 2
  • a

    ankushg

    08/19/2022, 7:33 AM
    We’re running into a strange issue in release iOS builds with the new memory model. Doesn’t happen in debug builds. When a user opens/closes a particular screen multiple times, on the ~12th try, we trigger the GC, and it crashes the app. The stracktrace looks something like:
    Crashed: GC thread
    0  QuizletSharedKotlin            0x919294 std::__1::invoke_result<kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory<kotlin::gc::ConcurrentMarkAndSweep>&, kotlin::gc::GCScheduler&)::$_2>::type kotlin::ScopedThread::Run<kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory<kotlin::gc::ConcurrentMarkAndSweep>&, kotlin::gc::GCScheduler&)::$_2>(kotlin::ScopedThread::attributes, kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory<kotlin::gc::ConcurrentMarkAndSweep>&, kotlin::gc::GCScheduler&)::$_2&&) + 1292
    1  QuizletSharedKotlin            0x91a214 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(kotlin::ScopedThread::attributes, kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory<kotlin::gc::ConcurrentMarkAndSweep>&, kotlin::gc::GCScheduler&)::$_2&&), kotlin::ScopedThread::attributes, kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory<kotlin::gc::ConcurrentMarkAndSweep>&, kotlin::gc::GCScheduler&)::$_2> >(void*) + 112
    2  libsystem_pthread.dylib        0x19ac _pthread_start + 148
    3  libsystem_pthread.dylib        0xe68 thread_start + 8
    It’s super hard for us to create a minimal reproduction of this, but in case it’s relevant, we’ve been able to repro this with: • Kotlin 1.7.10 and 1.7.20-Beta • SqlDelight 1.5.3 and 2.0.0-alpha03 • kotlinx.coroutines 1.6.4 (without the
    -native-mt
    suffix) • KMP-NativeCoroutines 0.12.6-new-mm Any tips on how to narrow this down?
    r
    a
    +4
    • 7
    • 12
  • b

    Benjamin Charais

    08/19/2022, 5:48 PM
    On the topic of KMP builds that output a static framework, I have been having a heck of a time when combining the static output with a pulled in pod.
    framework {
                baseName = "RedShirt"
                isStatic = true
                embedBitcode(BITCODE)
            }
    
            pod("xxxxx") {
                moduleName = "xxxx"
            }
            useLibraries()
    Using Kotlin
    1.7.10
    currently, the build goes swimmingly, and it very much seems that everything is in place, removing the pod, drastically impacts the output file size. I am running my output via
    podPublishReleaseXCFramework
    incase that has any bearing. The issue comes in when importing in XCode. It imports and references everything as expected, but when trying to build it will rarely, and intermittently work. The most common experience is the build failing with
    arm64
    errors around:
    Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_UIDevice", referenced from:
          objc-class-ref in RedShirt(result.o)
    
    
    Showing Recent Messages
    Undefined symbol: _OBJC_CLASS_$_UIDevice
    This error is not specific to arm, based on the build target. I haven't been able to track down any source on this kind of issue, everything is a brand new empty, and simple project. I don't believe I am missing anything, but this inconsistency is making things difficult.e
    • 1
    • 1
  • t

    Tristan

    08/20/2022, 1:08 AM
    Hello, does Kotlin native supports unsigned values? Currently running
    Compiler version info: Konan: 1.7.0 / Kotlin: 1.7.20
    I am getting these kind of errors
    api.cpp:14475:871: error: unknown type name 'libnative_kref_kotlin_UInt'; did you mean 'libnative_kref_kotlin_Int'?
    api.cpp:14412:1533: error: unknown type name 'libnative_kref_kotlin_ULong'; did you mean 'libnative_kref_kotlin_Long'?
    The documentation seems to say it should be supported.
    s
    • 2
    • 3
  • m

    Mahmoud Ahmed

    08/20/2022, 4:42 AM
    I want to know how to put the warning of 'magic number' in the ItellJ IDE and what should put in the @suppress() annotation to suppress it
  • t

    Tim Ortel

    08/20/2022, 9:19 PM
    I have an issue with using coroutines on kotlin native. I need to suspend my coroutine until a call to an api is done. However, the call to the api internally executes the code on another thread. Therefore, the following error is thrown:
    Uncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlinx.coroutines.internal.DispatchedContinuation
    runBlocking {
        withContext(Dispatchers.Main) {
            suspendCoroutine { c ->
                //handler is called from another thread.
                val handler = { x -> c.resume(x) }
    
                //Internally, schedules the work on another thread.
                //Therefore, c.resume() fails, as c is frozen.
                some_api_that_schedules_another_thread(handler)
            }
        }
    }
    Is there any way around of this. Changing the internal API is not possible.
    j
    t
    • 3
    • 6
  • a

    Alexandre Gressier

    08/21/2022, 1:11 PM
    Greetings! I am trying to call some functions of a Swift only library from Kotlin. I am aware that the only way to do this is to define some wrappers available in Objective-C and then compile it via Kotlin/Native. I started experimenting by creating a static library via Xcode, defining a Gradle task that runs
    xcodebuild -workspace MyLibInterop.xcworkspace -scheme MyLibInterop -sdk $sdk -configuration Release build SYMROOT=$PWD/build OBJROOT=$PWD/build
    , and finally creating a cinterop configuration via Gradle and a .def file. It works quite well. My setup is very similar to the one explained here: https://medium.com/kodein-koders/create-a-kotlin-multiplatform-library-with-swift-1a818b2dc1b0 (the ChachaPoly one). However I encounter a problem as soon as I start to add dependencies to this static library: I don’t know how to tell cinterop where to look for the dependency frameworks used by the static library. I used Cocoapods (without Gradle) to define the dependencies. The previous
    xcodebuild
    command then outputs several .framework directories that represent the dependencies in addition to the existing .h and .a files. My exact issue is ``ld: warning: Could not find or use auto-linked framework 'Amplify'` which is one of the .framework directories when running the task
    shared:linkPodDebugFrameworkIosArm64
    . I suppose that I have to define a recursive framework search path within my Kotlin cinterop configuration (i.e., the .def file). I came across the
    -F
    and
    -framework
    linker & compiler options but used them without any success. Thank you in anticipation for any kind of help you will be able to provide me with. I can provide any info or piece of code you need.
    r
    • 2
    • 7
  • s

    Sterling Albury

    08/22/2022, 1:34 AM
    I'm trying to use the integrated
    embedAndSignAppleFrameworkForXcode
    task, but I don't think the task is getting executed from xcode. I've added a run script to the build phases to run the task for my module, but when i build the xcode project, it's failing when trying to link the framework - the path doesn't exist. I can confirm that there's no build folder for the xcode framework in my kmp module. not sure what I'm doing wrong
    • 1
    • 1
  • s

    Sterling Albury

    08/22/2022, 5:17 PM
    I'm gettin a '*dyld[20011]: Library not loaded'* error when running my ios app - the framework isn't being found on the rpath. i think the only things i changed since my last successful run as that i added a new framework and added a swift package. I ended up explicitly adding the framework to the 'Frameworks, Libraries, and Embedded Content' section, which works, but is this actually what i want to do? in the kmm-basic-sample the 'shared' framework isn't added in this section, and thing seemed to be working before without adding my framework like this, so i feel like something got messed up. any insight is welcome.
    d
    • 2
    • 6
  • k

    kevin.cianfarini

    08/23/2022, 2:04 AM
    I've managed to get K/N to segfault. How do I print debug info to report this issue?
    n
    • 2
    • 16
  • d

    Didier Villevalois

    08/23/2022, 7:56 PM
    Hi all! I am trying to use a CI (Github workflows) to build my project Kzmq on macOS and Windows, in addition to the current Linux build. However, I am having problems with my cinterop in one of my modules (kzmq-libzmq). As I don't have any macOS or Windows computer at hand, I can't figure out the correct mix of: • installing the right dependencies (with their 'devel' version, i.e. header files), and • specifying the right include directories. I would be very grateful if some of you could bring me their cinterop wisdom, and even more grateful if they can try to run the build on a macOS or a Windows machine... The variables: • The project's module using cinterop: https://github.com/ptitjes/kzmq/tree/main/kzmq-libzmq/ • The cinterop def file: https://github.com/ptitjes/kzmq/blob/main/kzmq-libzmq/src/nativeInterop/cinterop/libzmq.def • The build file location where I am tweaking the headers' location further: https://github.com/ptitjes/kzmq/blob/main/kzmq-libzmq/build.gradle.kts#L21 • The two places where the cinterop fails by missing `zmq.h`: ◦ macosArm64: https://github.com/ptitjes/kzmq/runs/7962593655?check_suite_focus=true#step:6:713 ◦ mingw64: https://github.com/ptitjes/kzmq/runs/7962593817?check_suite_focus=true#step:6:407 • The packages that I install: ◦ on macos via brew: https://github.com/ptitjes/kzmq/pull/53/files#diff-9a1e47827bb935b60d2d4592090115539aa536c1a1229a6952ddd8384cb02a4c ◦ on windows via pacman: https://github.com/ptitjes/kzmq/pull/53/files#diff-72a5c9cf2c4b3e57d39405e7aa05c07ed44b8d21b0b8fc2a5aa539f56fd41c16 In advance, thanks a lot for your help!! Didier.
    b
    • 2
    • 3
  • s

    SeikoDes

    08/24/2022, 5:53 AM
    Hi all! I’m trying to introduce a rust library to KMP, but I don’t know how to configure ios cinterops, I’ve tried to build an xcode project to verify that the
    .h
    .a
    is working, but currently in KMP it prompts:
    Undefined symbols for architecture x86_64:
      "_CTFontGetXHeight", referenced from:
          SkScalerContext_Mac::generateFontMetrics(SkFontMetrics*) in libskia.a(fontmgr_mac_ct.SkScalerContext_mac_ct.o)
      "_CTFontGetUnderlineThickness", referenced from:
          SkScalerContext_Mac::generateFontMetrics(SkFontMetrics*) in libskia.a(fontmgr_mac_ct.SkScalerContext_mac_ct.o)
      "_CTFontGetUnderlinePosition", referenced from:
          SkScalerContext_Mac::generateFontMetrics(SkFontMetrics*) in libskia.a(fontmgr_mac_ct.SkScalerContext_mac_ct.o)
      "_CTFontGetAdvancesForGlyphs", referenced from:
          SkScalerContext_Mac::generateMetrics(SkGlyph*, SkArenaAlloc*) in libskia.a(fontmgr_mac_ct.SkScalerContext_mac_ct.o)
      "_CTFontCreatePathForGlyph", referenced from:
          SkScalerContext_Mac::generateMetrics(SkGlyph*, SkArenaAlloc*) in libskia.a(fontmgr_mac_ct.SkScalerContext_mac_ct.o)
          SkScalerContext_Mac::generatePath(SkGlyph const&, SkPath*) in libskia.a(fontmgr_mac_ct.SkScalerContext_mac_ct.o)
      "_CTFontDrawGlyphs", referenced from:
          SkCTFontGetSmoothBehavior() in libskia.a(libskia.SkCTFont.o)
          SkScalerContext_Mac::Offscreen::getCG(SkScalerContext_Mac const&, SkGlyph const&, unsigned short, unsigned long*, bool) in libskia.a(fontmgr_mac_ct.SkScalerContext_mac_ct.o)
      "_kCTFontVariationAxisMinimumValueKey", referenced from:
          SkCTVariationFromSkFontArguments(__CTFont const*, SkFontArguments const&) in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
          SkTypeface_Mac::onGetVariationDesignParameters(SkFontParameters::Variation::Axis*, int) const in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
      "_CTFontGetSize", referenced from:
          ...
      "_CTFontGetSymbolicTraits", referenced from:
          create_from_name(char const*, SkFontStyle const&) in libskia.a(fontmgr_mac_ct.SkFontMgr_mac_ct.o)
          SkTypeface_Mac::Make(std::__1::unique_ptr<__CTFont const, SkFunctionWrapper<void (void const*), &(CFRelease)> >, OpszVariation, std::__1::unique_ptr<SkStreamAsset, std::__1::default_delete<SkStreamAsset> >)::$_0::operator()() const in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
          SkTypeface_Mac::onGetAdvancedMetrics() const in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
      "_kCTFontFamilyNameKey", referenced from:
          SkTypeface_Mac::onCreateFamilyNameIterator() const in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
      "_CTFontCollectionCreateMatchingFontDescriptors", referenced from:
          (anonymous namespace)::SkCopyAvailableFontFamilyNames(__CTFontCollection const*) in libskia.a(fontmgr_mac_ct.SkFontMgr_mac_ct.o)
      "_CTFontCopyAttribute", referenced from:
          SkCTFontCreateExactCopy(__CTFont const*, double, OpszVariation) in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
          SkTypeface_Mac::onOpenStream(int*) const in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
      "_CTFontCreateForString", referenced from:
          SkFontMgr_Mac::onMatchFamilyStyleCharacter(char const*, SkFontStyle const&, char const**, int, int) const in libskia.a(fontmgr_mac_ct.SkFontMgr_mac_ct.o)
    ld: symbol(s) not found for architecture x86_64
    demo: https://github.com/qdsfdhvh/compose-hellorust
    n
    k
    • 3
    • 9
  • k

    kevin.cianfarini

    08/25/2022, 1:31 PM
    Is it possible to “statically link” cocoapods dependencies? My team wants to avoid introducing a cocoapods build step, but we want to implement some functionality on top of a cocoapods library in KMM. As far as I can tell in the docs, using cocoapods in KMM bubbles up a cocoapods build requirement to the associated iOS build.
    When applied, the CocoaPods plugin does the following:
    • Creates a
    podspec
    task which generates a Podspec file for the project.
    Without the support of swift package manager as part of the gradle build process, we’re left to use cocoapods or manually install the SDK. We’d prefer not to do this manually if we can avoid it.
    l
    • 2
    • 6
  • t

    Tristan

    08/31/2022, 3:20 AM
    Hello, can someone provide me an example of how to configure a project that compiles for multiple architecture? I can’t make sense of the documentation 😅 Inside of
    /common
    I have
    nativeMain
    , so
    /common/nativeMain
    and I’d like this folder to be use for macosX64 and linuxX64. I tried something like this, but it does seem to be it (I am getting KotlinSourceSet not found)
    val nativeMain by creating {
                dependsOn(commonMain)
                dependencies {
                    implementation(Deps.Ktor.clientCurl)
                }
            }
            val nativeTest by creating {
                dependsOn(commonTest)
            }
            val macosX64 by getting {
                dependsOn(nativeMain)
            }
    • 1
    • 1
  • a

    Adam Cooper

    08/31/2022, 4:20 AM
    Hi friends :) I am hoping to make a lifecycle manager for a C library, as I have done before in C++. Is there a clean way to get code to run on scope exit, even if an exception is thrown? I have discovered the
    try ... finally
    pattern, but I would prefer to not have to create an additional scope to accomplish what I am trying to do.
  • a

    Adam Cooper

    08/31/2022, 4:29 AM
    I'm also wondering: I've had an easy time using `ByteArray`s for C functions which want to accept a
    char **
    to write to, but what would be the best way to pass, say, an
    int *
    or any other primitive pointer? I can use
    alloc
    within
    memScoped
    , but is there any way to use a variable on the stack rather than the heap?
    n
    • 2
    • 4
  • m

    msink

    09/01/2022, 11:00 AM
    Hello. Is it known bug in recent versions that when compiling for
    mingw
    target and using extra precompiled libs from MSYS2 distribution - adding
    -Ldir -lfoo
    does not work, but adding
    dir/libfoo.a
    (full path to .a file) - works?
    • 1
    • 1
  • k

    K Merle

    09/02/2022, 6:46 AM
    If I may ask, which tool are you using here?
    a
    a
    • 3
    • 3
Powered by Linen
Title
k

K Merle

09/02/2022, 6:46 AM
If I may ask, which tool are you using here?
a

Arkadii Ivanov

09/02/2022, 2:54 PM
Perhaps we should use normal coroutines with the new memory model, not native-mt. Maybe that would fix the leaks?
a

Alex Acosta

09/02/2022, 2:55 PM
I am using Xcode Insturments Okay, I will play with latest 1.7.20 and move to normal coroutines and see
My theory is that it has to do with the fact that coroutines are required to be started from the main thread, so this is retaining the reference of it.
View count: 20