beego还有其他支持cgo的sqlite库吗?

图片描述

[root@host up]# ./main
[ORM]2018/10/02 01:48:15 register db Ping `default`, Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
must have one register DataBase alias named `default`
[root@host up]# 

beego写的web应用,在Mac OS下交叉编译出Linux版本,无法执行。打开CGO之后无法编译通过,这是什么原因?

go-sqlite3是否只能在Linux上安装go环境然后编译?

阅读 6.4k
1 个回答

mac上交叉编译linux的参数:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
你填对了吗?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题