Hi guys, I encountered a link error when I try to ...
# multiplatform
p
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
What libraries did you add?
p
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
Can you try using
-late
? Also, what Xcode and iOS versions are you aiming at?
p
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