golang/go

x/mobile: Undefined symbols _res_9_nclose with Go 1.20

Open

#58,416 opened on Feb 8, 2023

View on GitHub
 (15 comments) (4 reactions) (0 assignees)Go (19,008 forks)batch import
DocumentationNeedsFixOS-Darwinhelp wantedmobile

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

Contributor guide