在windows上编译linux的包时,执行:
```shell
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=linux go build -v -x -work main.go
```
报错:
```shell
# runtime/cgo
D:\Application\go\src\runtime\cgo\gcc_linux_amd64.c: In function '_cgo_sys_thread_start':
D:\Application\go\src\runtime\cgo\gcc_linux_amd64.c:62:2: error: unknown type name 'sigset_t'
sigset_t ign, oset;
^~~~~~~~
D:\Application\go\src\runtime\cgo\gcc_linux_amd64.c:67:2: error: implicit declaration of function 'sigfillset' [-Werror=implicit-function-declaration]
sigfillset(&ign);
^~~~~~~~~~
D:\Application\go\src\runtime\cgo\gcc_linux_amd64.c:62:16: error: unused variable 'oset' [-Werror=unused-variable]
sigset_t ign, oset;
^~~~
cc1.exe: all warnings being treated as errors
```
这怎么解决?
有疑问加站长微信联系(非本文作者)