Closed lilien1010 closed 1 month ago
You are trying to build with CGO_ENABLED=0 or you are missing the C compiler.
@gen2brain I am also encountering that error while using Docker. Can you help me fix it?
Enable cgo with CGO_ENABLED=1 and you will see the actual error.
enabled CGO still seeing errors
# 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
I think the problem is I am using CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o
Fixed by: brew tap SergioBenitez/osxct brew install x86_64-unknown-linux-gnu and build with : CGO_ENABLED=1 GOOS=linux go build -o main ./cmd/xxx/main.go
@gen2brain
I successfully built it, but when using
doc, err := fitz.New("test.pdf")
it throws an error:
cannot create context: incompatible header (1.23.7) and library (1.24.2) versions.
Which library is 'v1.24.2'? Can you help me?
I am moving all the logic of pdf to a sub module, but facing a error like below.
What could be the protential rootcauses?
xxx/internal/pkg/pdf/fitz
internal/pkg/pdf/fitz/pdf.go:15:45: undefined: fitz.Document internal/pkg/pdf/fitz/pdf.go:16:19: undefined: fitz.New internal/pkg/pdf/fitz/pdf.go:36:40: undefined: fitz.Document make: *** [build-service/xxxx] Error 1