Closed iamasbcx closed 5 months ago
In the latest version of the main branch, there is no longer a need to use CGO_ENABLED =1 for compilation. Just use go build
directly.
Sorry, the Readme has not been updated.
@iamasbcx Can you print Golang environment info via go env
command?
new Windows 10 go1.22.4.windows-386.msi i686-8.1.0-release-win32-sjlj-rt_v6-rev0.7z
I think you may have installed the wrong version of Golang. Here is a list on how to install 32/64-bit Go binary files. The Windows architecture for 386 is quite old and may not be what you need to install on a modern computer.
Target Architecture | Go Version Architecture | Description | Example Download Link |
---|---|---|---|
32-bit Windows | 386 | For compiling 32-bit x86 programs | go1.22.4.windows-386.msi |
64-bit Windows | amd64 | For compiling 64-bit x86 programs | go1.22.4. windows-amd64.msi |
64-bit Windows | arm64 | For compiling 64-bit ARM programs | go1.22.4. windows-arm64.msi |
Golang Support cross-compile for different OS and Arch, you don't need install target Go version. here's a example to build 32/64 bit windows binaray in Windows Console.
set GOARCH=386
set GOOS=windows
go build -o hack-browser-data-32bit.exe
set GOARCH=amd64
set GOOS=windows
go build -o hack-browser-data-64bit.exe
go x64 +minwg32 OK
Ref: https://github.com/flipped-aurora/gin-vue-admin/issues/1510
Seems this is a common error.
Describe the bug
win32
SET CGO_ENABLED=1 SET GOOS=windows SET GOARCH=386 go build
modernc.org/sqlite/lib
C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\defs.go:13:35: undefined: sqlite3_index_constraint C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\defs.go:14:35: undefined: sqlite3_index_orderby C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\defs.go:15:35: undefined: sqlite3_index_constraint_usage C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:19:5: undefined: Xsqlite3_threadsafe C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:29:11: undefined: Xsqlite3_config C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:29:32: undefined: SQLITE_CONFIG_MUTEX C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:29:122: undefined: SQLITE_OK C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:30:8: undefined: Xsqlite3_errstr C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:40:17: undefined: Sqlite3_mutex_methods C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:239:46: undefined: SQLITE_OK C:\Users\cx\go\pkg\mod\modernc.org\sqlite@v1.29.6\lib\mutex.go:239:46: too many errors
how todo