gogf/gf-cli

gf 不支持cgo

Closed this issue · 8 comments

使用 gf build 如果需要cgo支持就无法编译.

今天用到sqlite3,遇到同样的问题

gqcn commented

@chenall @fxk2006 那个跟gf没关系,研究下golang cgo吧。

这个倒不是什么大问题,不使用gf build就可以了,我改成了使用makefile来代替gf build的功能,也很方便。就是需要多写一个makefile文件。

gqcn commented

@chenall 升级最新的cli增加了cgo参数和配置项。

GoFrame CLI Tool v0.7.8, https://goframe.org
Install Path: H:\coding\go\bin\gf.exe
Build Detail:
  Go Version:  go1.14
  GF Version:  v1.13.1
  Git Commit:  3755de3087f8f00fc95ae0efec558842b3fc565b
  Build Time:  2020-08-17 21:08:34

试了一下新版本的,以下两个命令没有什么区别都是一样的错误。
gf build main.go
gf build main.go -c

直接使用原生的命令
go build main.go 正常

测试的代码
https://github.com/minus5/gofreetds/blob/master/example/mssql/main.go

gqcn commented

@chenall 我处理下

gqcn commented

@chenall gf update更新一下再试试。

最新版本,使用以下命令成功编译。
gf build main.go -c