golang/go

x/mobile: Undefined symbols _res_9_nclose with Go 1.20

Open

#58.416 aperta il 8 feb 2023

Vedi su GitHub
 (15 commenti) (4 reazioni) (0 assegnatari)Go (19.008 fork)batch import
DocumentationNeedsFixOS-Darwinhelp wantedmobile

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor