cpy3 icon indicating copy to clipboard operation
cpy3 copied to clipboard

Why is library 'resolv' prompted not to find this error

Open pilgirm0816 opened this issue 1 year ago • 3 comments

this is my code: `package main

import python3 "github.com/go-python/cpy3

func main() { python3.Py_Initialize() defer python3.Py_Finalize() python3.PyRun_SimpleString("print('hello world')") }`

The following problem arises after execution: /usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1 ld: library 'resolv' not found clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is my go env: GO111MODULE="on" GOARCH="arm64" GOBIN="" GOCACHE="/Users/binzhang/Library/Caches/go-build" GOENV="/Users/binzhang/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/binzhang/Code/Gostudy/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/binzhang/Code/Gostudy" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.20.1" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-O2 -g" CGO_CPPFLAGS="" CGO_CXXFLAGS="-O2 -g" CGO_FFLAGS="-O2 -g" CGO_LDFLAGS="-O2 -g" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f0/t254fnjs2wg7krz7xc1zksg00000gn/T/go-build4109859426=/tmp/go-build -gno-record-gcc-switches -fno-common"

This is my system env: PKG_CONFIG_PATH=/Users/binzhang/opt/anaconda3/envs/py37/lib/pkgconfig

This problem has been bothering me for several days and I don't know how to solve it. I would appreciate it if anyone could help😭😭 Excuse my poor English

pilgirm0816 avatar Jan 30 '24 08:01 pilgirm0816

邮件已收到。

xiaoqin422 avatar Jan 30 '24 08:01 xiaoqin422

You can try running it in an x86 Docker container.

M-Quadra avatar Jan 30 '24 08:01 M-Quadra