Closed mannixli closed 3 years ago
[mylinux]$ go get -t "github.com/yanyiwu/gojieba"
# github.com/yanyiwu/gojieba cgo: gcc did not produce error at completed:1 on input: #line 1 "cgo-builtin-prolog" #include <stddef.h> /* for ptrdiff_t and size_t below */ /* Define intgo when compiling with GCC. */ typedef ptrdiff_t intgo; #define GO_CGO_GOSTRING_TYPEDEF typedef struct { const char *p; intgo n; } _GoString_; typedef struct { char *p; intgo n; intgo c; } _GoBytes_; _GoString_ GoString(char *p); _GoString_ GoStringN(char *p, int l); _GoBytes_ GoBytes(void *p, int n); char *CString(_GoString_); void *CBytes(_GoBytes_); void *_CMalloc(size_t); __attribute__ ((unused)) static size_t _GoStringLen(_GoString_ s) { return (size_t)s.n; } __attribute__ ((unused)) static const char *_GoStringPtr(_GoString_ s) { return s.p; } #line 3 "/home/bae/go-env/goSpace/pkg/mod/github.com/yanyiwu/gojieba@v1.1.2/jieba.go" #include <stdlib.h> #include "jieba.h" #line 1 "cgo-generated-wrapper" #line 1 "not-declared" balabala.......................... void __cgo_f_20_5(void) { static const char __cgo_undefined__5[] = (int); } #line 1 "completed" int __cgo__1 = __cgo__2; full error output: cc1: error: unrecognized command line option "-fno-lto"
It works fine on my computer(macOS Big Sur).
是我gcc版本太低,升级后好了。
[mylinux]$ go get -t "github.com/yanyiwu/gojieba"