adrium / goheif

go gettable decoder/converter for HEIF/HEIC based on libde265
43 stars 14 forks source link

Can't build for MacOS amd64/arm64 #7

Open MaestroError opened 1 year ago

MaestroError commented 1 year ago

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 :+1:

MaestroError commented 1 year ago

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 commented 1 year ago

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/goheif@v0.0.0-20230113233934-ca402e77a786/libde265

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

MaestroError commented 1 year ago

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

cruvie commented 1 year ago

@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 .