yanyiwu / gojieba

"结巴"中文分词的Golang版本
MIT License
2.42k stars 302 forks source link

在beego中使用打包报错 #71

Closed zone-7 closed 3 weeks ago

zone-7 commented 4 years ago

执行打包指令: 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

我是错在哪个环节了?

GendSmith commented 4 years ago

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

deep-project commented 4 years ago

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

Hanggi commented 3 years ago

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

HQ1363 commented 3 years ago

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

chaegumi commented 1 year ago

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

github-actions[bot] commented 1 month ago

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] commented 3 weeks ago

This issue has been automatically closed due to inactivity. If the issue still exists, please reopen it.