Ошибка кросс-компиляции - TheTitanrain / w32 не найден - PullRequest
0 голосов
/ 07 октября 2019

Я пытаюсь кросс-компилировать (создать exe-файл Windows32 на Linux64) исходный файл golang, который использует andlabs / ui . Однако я получаю следующую ошибку:

$ GOOS=windows GOARCH=386 go build mysrc.go
/home/iuser/go/src/github.com/sqweek/dialog/dlgs_windows.go:10:2: cannot find package "github.com/TheTitanrain/w32" in any of:
        /usr/local/go/src/github.com/TheTitanrain/w32 (from $GOROOT)
        /home/iuser/go/src/github.com/TheTitanrain/w32 (from $GOPATH)
mysrc.go:5:9: build constraints exclude all Go files in /home/iuser/go/src/github.com/andlabs/ui

Я пытался установить github.com/TheTitanrain/w32, но было слишком много ошибок:

$ go get github.com/TheTitanrain/w32
# github.com/TheTitanrain/w32
/home/iuser/go/src/github.com/TheTitanrain/w32/advapi32.go:15:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/alpc.go:15:13: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/comctl32.go:13:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/comdlg32.go:13:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/create_process.go:13:13: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/dwmapi.go:21:14: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/fork.go:37:10: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/gdi32.go:13:13: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/gdiplus.go:92:15: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/kernel32.go:13:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/TheTitanrain/w32/gdiplus.go:92:15: too many errors

Аналогично с github.com/AllenDang / w32 (как уже упоминалось здесь ):

$ go get github.com/AllenDang/w32
# github.com/AllenDang/w32
/home/iuser/go/src/github.com/AllenDang/w32/advapi32.go:15:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/alpc.go:15:13: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/comctl32.go:13:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/comdlg32.go:13:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/create_process.go:13:13: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/dwmapi.go:21:14: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/fork.go:37:10: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/gdi32.go:13:13: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/gdiplus.go:92:15: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/kernel32.go:13:16: undefined: syscall.NewLazyDLL
/home/iuser/go/src/github.com/AllenDang/w32/gdiplus.go:92:15: too many errors

Как я могу исправить эту проблему?

...