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

Can't build for MacOS amd64/arm64 #7

Open
MaestroError opened this issue Feb 26, 2023 · 4 comments
Open

Can't build for MacOS amd64/arm64 #7

MaestroError opened this issue Feb 26, 2023 · 4 comments

Comments

@MaestroError
Copy link

MaestroError commented Feb 26, 2023

Hi! I am trying to build app (php-heic-to-jpg) on linux (Ubuntu) for MacOS and getting error for both architectures

ios/amd64

Command:
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o "bin/heicToJpg-ios-amd64" github.com/MaestroError/php-heic-to-jpg
Error:

# runtime/cgo
gcc: error: x86_64: No such file or directory
gcc: error: unrecognized command line option '-arch'

ios/arm64

Command:
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o "bin/heicToJpg-ios-arm64" github.com/MaestroError/php-heic-to-jpg
Error:

# runtime/cgo
gcc: error: arm64: No such file or directory
gcc: error: unrecognized command line option '-arch'

Please, tell me If you will need any other information about the error from me. I am sure we can solve this problem 👍

@MaestroError
Copy link
Author

I built it with crazy-max/xgo, but not sure yet if it works.
Built with command sudo /home/maestroerror/go/bin/xgo --targets=darwin/* github.com/MaestroError/php-heic-to-jpg

@cruvie
Copy link

cruvie commented Mar 17, 2023

encounter same err when build amd64 linux on m2 mac

package command-line-arguments
        imports github.com/adrium/goheif
        imports github.com/adrium/goheif/libde265: build constraints exclude all Go files in /Users/xxx/go/pkg/mod/github.com/adrium/[email protected]/libde265

with command
GOARCH=amd64 GOOS=linux go build -o ./program/go_m ../go_m/main/main.go

@MaestroError
Copy link
Author

@gkdgo Try to use crazy-max/xgo, I used it on Linux (Ubuntu) and built it for MacOS successfully. Hope it will help 👍

@cruvie
Copy link

cruvie commented Mar 19, 2023

@gkdgo Try to use crazy-max/xgo, I used it on Linux (Ubuntu) and built it for MacOS successfully. Hope it will help 👍

thanks , but it seems like it's no longer maintained .

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

2 participants