https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
p

Piasy

06/01/2020, 2:44 PM
Hi guys, I encountered a link error when I try to build Kotlin code into a static library, then link it into a iOS framework for simulator architecture (
x86_64
), bunch of undefined reference to symbols like
___res_9_p_type_syms
,
_BZ2_bzWriteClose
,
_CKRecordShareKey
,
_kCLLocationCoordinate2DInvalid
,
_compression_stream_init
and
_at_encoder_get_block_alpha
. I managed to add some libraries to fix all of them except for
_at_encoder_get_block_alpha
. I'm using Kotlin 1.3.71, there is no error at all on 1.3.61.
s

Sean Najera

06/01/2020, 4:29 PM
What libraries did you add?
p

Piasy

06/01/2020, 10:57 PM
I added these linker flags:
-lresolve -lbz2 -framework CloudKit -framework CoreLocation -lcompression
. BTW, arm64 architecture could link success without these flags on 1.3.71.
a

Artyom Degtyarev [JB]

06/05/2020, 1:29 PM
Can you try using
-late
? Also, what Xcode and iOS versions are you aiming at?
p

Piasy

06/30/2020, 1:42 PM
Hi @Artyom Degtyarev [JB], thank you for your reply, and sorry about the delayed response, I missed the notification 😞 I'll try it right now.
-late
works! BTW, in my message 29 days ago, there was a mistake, I need add
-lresolv.9
rather than
-lresolve
. Thank you @Artyom Degtyarev [JB]!
🎉 1
11 Views