go-sqlite3: go build error
i use shell script to go build, but i failed
GOOS=linux GOARCH=386 go build && mv proxyWebApplication proxyWeb/proxyWebApplication && tar zcfv "zip/proxy-linux-386.tar.gz" proxyWeb
why?
this is error information
../github.com/mattn/go-sqlite3/sqlite3_go18.go:26: undefined: SQLiteConn ../github.com/mattn/go-sqlite3/sqlite3_go18.go:27: undefined: namedValue
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 26 (6 by maintainers)
Links to this issue
- Platform_Mirocod/go-sqlite3 at 3b0303a4fcbb8b8fda258e11edb3fd3c5c09396e - Platform_Mirocod - Платформа Мирокод
- Platform_Mirocod/README.md at 3b0303a4fcbb8b8fda258e11edb3fd3c5c09396e - Platform_Mirocod - Платформа Мирокод
- xorm-cmd/README.md at master - xorm-cmd - Gitea: Git with a cup of tea
- xorm-dbweb/go-sqlite3 at master - xorm-dbweb - Gitea: Git with a cup of tea
- xorm-cmd/go-sqlite3 at master - xorm-cmd - Gitea: Git with a cup of tea
- reverse/go-sqlite3 at master - reverse - Gitea: Git with a cup of tea
- cmd/README.md at master - cmd - Gitea: Git with a cup of tea
- cmd/go-sqlite3 at master - cmd - Gitea: Git with a cup of tea
- cmd/README.md at master - cmd - Gitea: Git with a cup of tea
- cmd/go-sqlite3 at master - cmd - Gitea: Git with a cup of tea
Commits related to this issue
- Update documentation Compile Section Closes #175 Compile Section Closes #201 Compile Section Closes #206 Compile Section Closes #404 Compile Section Closes #217 Compile Section Closes #224 Compile Se... — committed to gjrtimmer/go-sqlite3 by gjrtimmer 8 years ago
- Update documentation Compile Section Closes #175 Compile Section Closes #201 Compile Section Closes #206 Compile Section Closes #404 Compile Section Closes #217 Compile Section Closes #224 Compile Se... — committed to gjrtimmer/go-sqlite3 by gjrtimmer 8 years ago
For those having this issue on linux (especially if you’re using Ubuntu), please do the following:
The above command will install cross compiler for C. Then you can build with the following code:
To build for windows amd64:
Similarly for windows 386:
Hope this helps.
@GJRTimmer Sorry, I gave up on using SQLite3 in my project because this was too complicated to cross-compile for each OS. I switched to https://github.com/coreos/bbolt in my project which is 100% Go and allows me to compile for each os/arch on my mac.
you need to use cross-C-compiler. you are doing:
This should be:
So you need to set environment variable CC to the cross-C-compiler.
Because you don’t install cross C compiler for linux-i386.