golang/go

x/mobile: Undefined symbols _res_9_nclose with Go 1.20

Open

#58,416 创建于 2023年2月8日

在 GitHub 查看
 (15 评论) (4 反应) (0 负责人)Go (19,008 fork)batch import
DocumentationNeedsFixOS-Darwinhelp wantedmobile

仓库指标

Star
 (133,883 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

What version of Go are you using (go version)?

Does this issue reproduce with the latest release?

Using MacOS with Go 1.20 error, no issue in 1.19.5

What operating system and processor architecture are you using (go env)?

What did you do?

After compiling using gomobile bind -v -ldflags='-s -w' -target=ios -o libtest.xcframework github.com/example/test in terminal and import the libtest.xcframework library to xcode, it will show error in xcode when trying to compile ios app

What did you expect to see?

What did you see instead?

Undefined symbols for architecture arm64: "_res_9_nclose", referenced from: _internal/syscall/unix.libresolv_res_9_nclose_trampoline.abi0 in Libtest(go.o) "_res_9_ninit", referenced from: _internal/syscall/unix.libresolv_res_9_ninit_trampoline.abi0 in Libtest(go.o) "_res_9_nsearch", referenced from: _internal/syscall/unix.libresolv_res_9_nsearch_trampoline.abi0 in Libtest(go.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Related: https://github.com/golang/go/issues/58159

贡献者指南