Hey, all. Question: I'm working on getting my KMP ...
# multiplatform
d
Hey, all. Question: I'm working on getting my KMP app to come up on iOS (KMP for shared code, SwiftUI for the iOS UX) and have it, without the shared library, starting with hard-coded data displayed. The issue I'm hitting is, now that I've explicitly added the shared library to one of my components, the app fails to link, saying it can't find the sqllite3 methods it needs: errors like:
ld: Undefined symbols:
_sqlite3_bind_blob, referenced from:
_co_touchlab_sqliter_sqlite3_sqlite3_bind_blob_wrapper69 in shared[6](libco.touchlab:sqliter-driver-cinterop-sqlite3-cache.a.o)
a
You need to add sqdelight gradle plugin or add -lsqlite option to the linker
d
@Alexander Zhirkevich Would that be in one of the configuration files under iosApp or elsewhere?
a
To the build.gradle of your shared module
d
Sorry to sound dense (this is my first KMP project, and I'm light on Gradle fu). Can you point me to an example I can use to guide me?
a
Gradle plugin should be enough if you have dynamic framework. Look for sqldelight setup guide
d
I have this plugin defined at the top of that build.gradle.kts file: id("app.cash.sqldelight").version("2.0.0")
This is my working branch, if it helps: https://github.com/mcpierce/variant/tree/feature/issue-3
a
Issue is isStatic=true. You need to link SQLite then or remove this line
👍 1
d
kk - commenting it out and giving it a try.
Very cool, that appears to have fixed the issue! Thank you.
a
Nice. If you will ever have requirement in static framework in the future just search isStatic or -lsqlite in sqldelight issues. There are examples on what you need to add