fyne-io / fyne-cross

Cross compiler tool for Fyne apps
BSD 3-Clause "New" or "Revised" License
234 stars 48 forks source link

Compile fyne application for Windows operating system, gcc_linux-amd64. c: 63:2: error: unknown type name 'sigset_t' #221

Open lizhao-8202 opened 6 months ago

lizhao-8202 commented 6 months ago

os:Win10 Professional Edition go version: go1.19.1 windows/amd64

I plan to package the fyne code under Windows as a Linux version, but there is a compilation error. Related operations: 1、SET CGO_ENABLED=1 2、SET GOOS=linux 3、go build main/build_job.go

Error logs:

runtime/cgo

gcc_linux_amd64.c: In function '_cgo_sys_thread_start': gcc_linux_amd64.c:63:2: error: unknown type name 'sigset_t'; did you mean '_sigset_t'? sigset_t ign, oset; ^~~~ _sigset_t gcc_linux_amd64.c:68:2: error: implicit declaration of function 'sigfillset' [-Werror=implicit-function-declaration] sigfillset(&ign); ^~~~~~ gcc_linux_amd64.c:63:16: error: unused variable 'oset' [-Werror=unused-variable] sigset_t ign, oset; ^~~~ cc1.exe: all warnings being treated as errors

I want to know how fyne implements cross compilation on Windows machines

andydotxyz commented 6 months ago

It looks like you don't have the C compiler for linux, it should be set with CC. https://docs.fyne.io/started/cross-compiling

If this sounds complicated you can use fyne-cross instead which containerises the whole setup for you.