Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross build with cgo error #1

Open
limboinf opened this issue Jan 4, 2018 · 0 comments
Open

Cross build with cgo error #1

limboinf opened this issue Jan 4, 2018 · 0 comments

Comments

@limboinf
Copy link
Owner

limboinf commented Jan 4, 2018

没法在Mac OSX上交叉编译到Linux,Windows,原因是go-sqlite3使用了cgo,错误信息:

# Build for win
go clean
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-X main.Version="1.2""
# ydao/vendor/github.com/mattn/go-sqlite3
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:18: undefined: SQLiteConn
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:26: undefined: SQLiteConn
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:27: undefined: namedValue
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:29: undefined: namedValue
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:35: undefined: SQLiteConn
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:36: undefined: namedValue
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:44: undefined: SQLiteConn
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:49: undefined: SQLiteConn
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:54: undefined: SQLiteStmt
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:63: undefined: SQLiteStmt
vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:36: too many errors
make: *** [release] Error 2

相关链接:mattn/go-sqlite3#384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant