#1 Compiling for Windows isn't as easy as I hoped

오픈
stevet2 년 전을 오픈 · 0개의 코멘트
Steve Thielemann 코멘트됨, 2 년 전

Warning: Cross compiling (On Linux for Windows) appears to work, but doesn't!

GOOS=windows GOARCH=amd64 go build

wine test-lock.exe 
2022/02/23 23:48:56 Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
panic: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Compiling for Windows requires Windows + TDM-GCC.

https://stackoverflow.com/questions/43580131/exec-gcc-executable-file-not-found-in-path-when-trying-go-build

http://tdm-gcc.tdragon.net/download

After installing this, I was able to build the windows binary with go-sqlite3 support.

_Warning_: Cross compiling (On Linux for Windows) appears to work, but doesn't! `GOOS=windows GOARCH=amd64 go build` ``` wine test-lock.exe 2022/02/23 23:48:56 Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub panic: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub ``` Compiling for Windows requires Windows + TDM-GCC. https://stackoverflow.com/questions/43580131/exec-gcc-executable-file-not-found-in-path-when-trying-go-build http://tdm-gcc.tdragon.net/download After installing this, I was able to build the windows binary with go-sqlite3 support.
로그인하여 이 대화에 참여
마일스톤 없음
담당자 없음
참여자 1명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.