go build failed: undefined: gosseract.NewClient when CGO_ENABLED=0
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
main.go:10:22: undefined: gosseract.NewClient
If I change CGO_ENABLED to CGO_ENABLED=1 then will get other errors:
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build main.go
# runtime/cgo
linux_syscall.c:67:13: error: call to undeclared function 'setresgid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
linux_syscall.c:67:13: note: did you mean 'setregid'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:593:6: note: 'setregid' declared here
linux_syscall.c:73:13: error: call to undeclared function 'setresuid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
linux_syscall.c:73:13: note: did you mean 'setreuid'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:595:6: note: 'setreuid' declared here
Reproducibility
Reproducibility Frequency
100%
Environment
Darwin JMS-Macbook.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020 arm64
Summary
go build failed:
undefined: gosseract.NewClient
when CGO_ENABLED=0If I change CGO_ENABLED to CGO_ENABLED=1 then will get other errors:
Reproducibility
Reproducibility Frequency
Environment