升级到 1.4.1 版本,这个问题没有了:
In file included from jieba.cpp:5:
In file included from ../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/Jieba.hpp:4:
In file included from ../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/QuerySegment.hpp:8:
../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/DictTrie.hpp:152:12: warning: variable 'lineno' set but not used [-Wunused-but-set-variable]
../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/DictTrie.hpp:217:17: warning: variable 'lineno' set but not used [-Wunused-but-set-variable]
升级到 1.4.1 版本,这个问题没有了: In file included from jieba.cpp:5: In file included from ../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/Jieba.hpp:4: In file included from ../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/QuerySegment.hpp:8: ../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/DictTrie.hpp:152:12: warning: variable 'lineno' set but not used [-Wunused-but-set-variable] ../../../pkg/mod/github.com/yanyiwu/gojieba@v1.3.0/deps/cppjieba/DictTrie.hpp:217:17: warning: variable 'lineno' set but not used [-Wunused-but-set-variable]
但是交叉编译还是不行:GOOS=linux GOARCH=amd64 go build -gcflags=all='-N -l' -o my-app,报错: undefined: gojieba.Jieba undefined: gojieba.NewJieba
看了下里面用了C/C++相关的东西,大佬们有办法避免这个问题吗?