Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to cross compile a project from macos to linux #179

Open
Banyc opened this issue Dec 27, 2021 · 0 comments
Open

Failed to cross compile a project from macos to linux #179

Banyc opened this issue Dec 27, 2021 · 0 comments

Comments

@Banyc
Copy link

Banyc commented Dec 27, 2021

Environment

  • go version: 1.17.5
  • zmq4 version: v1.2.7
  • libsodium version: 1.0.18_1
  • macos version: 12.0.1

Way to Reproduce

  1. make a go project in macos;
  2. run
    env GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o "bin/main-linux-amd64" "main.go"
  3. go fails to produce a binary file.

Unexpected Output

# runtime/cgo
linux_syscall.c:67:13: error: implicit declaration of function 'setresgid' is invalid in C99 [-Werror,-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: implicit declaration of function 'setresuid' is invalid in C99 [-Werror,-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant