Go build packaging Error:
TARGET_OS_MAC & IOMasterPort
#github.com/shirou/gopsutil/cpu
../../../../go/pkg/mod/github.com/shirou/[email protected]+incompatible/cpu/cpu_darwin_cgo.go:13:5:
warning: 'TARGET_OS_MAC' is not defined, evaluates to 0 [-Wundef-prefix=TARGET_OS_]
#github.com/shirou/gopsutil/disk
iostat_darwin.c:28:2:
warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:132:1:
note: 'IOMasterPort' has been explicitly marked deprecated here
I don’t know the cause of the problem at present. It may be caused by the upgrade of the MAC system
My version is MacOS Monterey 12.3
Solution (not necessarily effective)
Modify CGO_ENABLED,default is CGO_ENABLED="1"
go env -w CGO_ENABLED="0"
Read More:
- [Solved] Error running ‘go build myfir_go_project‘: Cannot run program
- [Solved] Golang Error: main.go:5:2: package go_code/chapter10/factory/model is not in GOROOT
- [Solved] VScode Error: build constraints exclude all Go files in syscall\js
- [Solved] cannot find package “go.opentelemetry.io/otel/api/trace“ in any of
- [Solved] Fabric_sdk_go:QueryBlockConfig failed: QueryBlockConfig failed: target(s) required
- [Solved] Error: error getting chaincode bytes: ‘go list‘ failed with: cannot find module providing package
- [Solved] Unity Package Error: FAILURE: Build failed with an exception.
- [GO] The entry file under the main package in golang calls other go file functions and appears undefined
- Vue Package Error: npm ERR! missing script: build
- [Solved] Unity package Error: CommandInvokationFailure: Gradle build failed.
- [Solved] Android Kotlin Package release Error: Lint found fatal errors while assembling a release target.
- [Solved] pytorch CrossEntropyLoss Error: RuntimeError: 1D target tensor expected, multi-target not supported
- [Solved] Mac Runjmeter WARNING: package sun.awt.X11 not in java.desktop
- Go declares that the local variable does not use command line arguments. Main. Go: 4:6: a declared but not used
- [Solved] .\main.go:3:6: missing function body .\main.go:4:1: syntax error: unexpected semicolon or newline be
- [Solved] electron-builder Package mac Error: panic: runtime error: index out of range
- Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl
- [Solved] Flutter package flutter build apk Error: permission-handle
- [Solved] NPM run build package error: Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory