gojieba icon indicating copy to clipboard operation
gojieba copied to clipboard

在beego中使用打包报错

Open zone-7 opened this issue 5 years ago • 6 comments
trafficstars

执行打包指令: bee pack -be GOOS=linux -be GOARCH=amd64 出现下面报错:

2020/07/04 10:55:40 INFO ▶ 0003 Using: GOOS=linux GOARCH=amd64 #test/service service/MethineService.go:121:9: undefined: gojieba.NewJieba service/ModelService.go:22:9: undefined: gojieba.NewJieba 2020/07/04 10:55:41 FATAL ▶ 0004 exit status 2

我是错在哪个环节了?

zone-7 avatar Jul 04 '20 03:07 zone-7

我也遇到一样的问题,,,

GendSmith avatar Jul 19 '20 14:07 GendSmith

因为使用的go编辑器,不能编译C,gojieba调用了C。设置 CGO_ENABLED=1 再编译试试。如果报其他错误,说明你遇到了和我一样的问题,逃。。。

deep-project avatar Jul 20 '20 09:07 deep-project

有什么解决或者替代方案吗?

Hanggi avatar Nov 15 '20 14:11 Hanggi

mac 系统不支持,换到 linux 环境下, 再 pack, 就没问题了

HQ1363 avatar Feb 01 '21 12:02 HQ1363

2023年,我今天构建了也不行,一样的问题 controllers\gojieba.go:24:7: undefined: gojieba.NewJieba controllers\gojieba.go:74:29: undefined: gojieba.SearchMode controllers\gojieba.go:78:28: undefined: gojieba.DefaultMode controllers\gojieba.go:101:7: undefined: gojieba.NewJieba

chaegumi avatar Mar 16 '23 01:03 chaegumi

This issue has not been updated for over 1 year and will be marked as stale. If the issue still exists, please comment or update the issue, otherwise it will be closed after 7 days.

github-actions[bot] avatar Sep 17 '24 13:09 github-actions[bot]