go-sqlite3 icon indicating copy to clipboard operation
go-sqlite3 copied to clipboard

go get -x github.com/mattn/go-sqlite3

Open huhailang9012 opened this issue 5 years ago • 3 comments

图片

huhailang9012 avatar Oct 10 '20 12:10 huhailang9012

It looks like cgo isn't correctly working on your system. Check the installation of your C compiler and/or Go.

arp242 avatar Dec 26 '20 09:12 arp242

Is their a solution for this? I have the same issue on windows.

I installed gcc via win-builds.org.

Output

❯ go get -x github.com/mattn/go-sqlite3
# get https://proxy.golang.org/github.com/@v/list
# get https://proxy.golang.org/github.com/mattn/@v/list
# get https://proxy.golang.org/github.com/mattn/go-sqlite3/@v/list
# get https://proxy.golang.org/github.com/@v/list: 410 Gone (0.115s)
# get https://proxy.golang.org/github.com/mattn/go-sqlite3/@v/list: 200 OK (0.117s)
# get https://proxy.golang.org/github.com/mattn/@v/list: 410 Gone (0.117s)
WORK=C:\Users\stuarts\AppData\Local\Temp\go-build2064351143
mkdir -p $WORK\b001\
cd C:\Users\stuarts\go\pkg\mod\github.com\mattn\[email protected]
TERM='dumb' CGO_LDFLAGS='"-g" "-O2" "-lmingwex" "-lmingw32"' "C:\\Program Files\\Go\\pkg\\tool\\windows_amd64\\cgo.exe" -objdir "$WORK\\b001\\" -importpath github.com/mattn/go-sqlite3 -- -I "$WORK\\b001\\" -g -O2 -std=gnu99 -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE=1 -DHAVE_USLEEP=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_TRACE_SIZE_LIMIT=15 -DSQLITE_OMIT_DEPRECATED -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -Wno-deprecated-declarations "-IC:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]" -fno-stack-check -fno-stack-protector -mno-stack-arg-probe "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\backup.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\callback.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\error.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\sqlite3.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\sqlite3_context.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\sqlite3_load_extension.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\sqlite3_opt_userauth_omit.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\sqlite3_type.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\sqlite3_usleep_windows.go" "C:\\Users\\stuarts\\go\\pkg\\mod\\github.com\\mattn\\[email protected]\\sqlite3_windows.go"
go build github.com/mattn/go-sqlite3: C:\Program Files\Go\pkg\tool\windows_amd64\cgo.exe: exit status 2
⚡ stuarts@X-LAP-523 > L:\Agent\ProxyApi >> dev-agent-2.0 ≣ +0 ~1 -0 | +4 ~5 -0 !>                                                                                     
❯

stuartstein777 avatar Jun 15 '21 15:06 stuartstein777

The error is:

go build github.com/mattn/go-sqlite3: C:\Program Files\Go\pkg\tool\windows_amd64\cgo.exe: exit status 2

No error output at all(?)

I don't know; I don't use Windows; maybe try installing Go to a path without a space (Program Files)? This can sometimes cause problems, but I have no idea if that's the problem in your case.

arp242 avatar Jun 15 '21 16:06 arp242