AllenDang / w32

A wrapper of windows apis for the Go Programming Language.
Other
762 stars 246 forks source link

Unable to Use for cross compiling #88

Open Merith-TK opened 4 years ago

Merith-TK commented 4 years ago
# github.com/AllenDang/w32
/home/developer/go/src/github.com/AllenDang/w32/advapi32.go:15:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/alpc.go:15:13: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/comctl32.go:13:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/comdlg32.go:13:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/create_process.go:13:13: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/dwmapi.go:21:14: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/fork.go:37:10: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/gdi32.go:13:13: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/gdiplus.go:92:15: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/kernel32.go:13:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/gdiplus.go:92:15: too many errors

when i try to goget for my archlinux machine

gonutz commented 4 years ago

You have to set the environment variable

GOOS=windows

before calling go build or go run. This tells Go that you want to build for windows. The syscall package only has NewLazyDLL etc. on Windows. syscall is OS specific.