robotn / gohook

GoHook, Go global keyboard and mouse listener hook
MIT License
314 stars 44 forks source link

Can't crosscompile from linux to windows #27

Open encendre opened 3 years ago

encendre commented 3 years ago

Hi, i'm on linux and when i run the following command GOOS=windows go test -c in this repository i go these errors:

# github.com/robotn/gohook [github.com/robotn/gohook.test]
./hook_test.go:13:7: undefined: Start
./hook_test.go:18:7: undefined: RawcodetoKeychar
./hook_test.go:21:7: undefined: KeychartoRawcode

Same when i try to crosscompile my project with depend on gohook

yu13n commented 2 years ago

This is gcc environment's error. Install mingw-w64-gcc, and run CGO_ENABLED=1 GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ go build

intmian commented 2 years ago

thx,it do work