Has anybody run a macOS App with KMM that access a...
# multiplatform
j
Has anybody run a macOS App with KMM that access an sqlite database? I tried sqldelight and room, but in both cases the build of the application fails due to a linker error.
Copy code
Undefined symbols for architecture arm64:
  "_sqlite3_mutex_held", referenced from:
      _sqlite3_sqlite3_mutex_held_wrapper226 in shared[15](libandroidx.sqlite:sqlite-framework-cinterop-sqlite3-cache.a.o)
  "_sqlite3_mutex_notheld", referenced from:
      _sqlite3_sqlite3_mutex_notheld_wrapper227 in shared[15](libandroidx.sqlite:sqlite-framework-cinterop-sqlite3-cache.a.o)
  "_sqlite3_unlock_notify", referenced from:
      _sqlite3_sqlite3_unlock_notify_wrapper252 in shared[15](libandroidx.sqlite:sqlite-framework-cinterop-sqlite3-cache.a.o)
  "_sqlite3_win32_set_directory", referenced from:
      _sqlite3_sqlite3_win32_set_directory_wrapper181 in shared[15](libandroidx.sqlite:sqlite-framework-cinterop-sqlite3-cache.a.o)
  "_sqlite3_win32_set_directory16", referenced from:
      _sqlite3_sqlite3_win32_set_directory16_wrapper183 in shared[15](libandroidx.sqlite:sqlite-framework-cinterop-sqlite3-cache.a.o)
  "_sqlite3_win32_set_directory8", referenced from:
      _sqlite3_sqlite3_win32_set_directory8_wrapper182 in shared[15](libandroidx.sqlite:sqlite-framework-cinterop-sqlite3-cache.a.o)
ld: symbol(s) not found for architecture arm64
I adjusted my linking options in xcode to include
-lsqlite3
and I can see that more symbols can be found, but not the one mentioned here. The app builds fine for iOS, but on macOS it fails. The app itself is a iOS target that supports macOS as well. UI is written in SwiftUI
b
@Julian BIssekkou - Did you ever figure this out?
j
Yeah I got it to work and it was a setting in xcode. I found the answer somewhere in a issue for realm multiplatform where I was looking for alternatives. This was only a small side project, so I dont have the sources anymore 😕
b
ok. I'm running into a similar issue. Same error, but for an iOS app. The Xcode Previews for the SwiftUI views fail and get this error.
j
Are you using legacy previews in xcode? If not, give it a try
b
I've tried that ... no luck
Oh well, thanks for getting back to me. I'll keep digging
✅ 1