cat icon indicating copy to clipboard operation
cat copied to clipboard

go客户端go get报错

Open qietingfengling opened this issue 4 years ago • 1 comments

go get github.com/dianping/cat/lib/go/...

出现以下错误:

\Temp\go-build290997150\b001_x002.0: In function callLogTransaction \[email protected]+incompatible/lib/go/ccat/ccat.h:12: undefined reference to newTransaction \Temp\go-build290997150\b001_x002.0: In function callLogEvent \[email protected]+incompatible/lib/go/ccat/ccat.h:29: undefined reference to newEvent ... collect2.exe: error : ld returned 1 exit status

请问是什么引起的?是gcc版本问题么?

qietingfengling avatar Jan 11 '21 09:01 qietingfengling

gocat 通过 cgo 实现, 依赖 ccat, 如果遇到预编译的 ccat ABI 不兼容,需要自行编译 ccat

git clone --depth=1 https://github.com/dianping/cat.git
cd cat/lib/c/
cmake .
make -j
sudo cp libcatclient.a $(go env GOMODCACHE)/github.com/dianping/[email protected]+incompatible/lib/go/ccat/lib/linux/libcatclient.a

sophgn avatar Mar 17 '21 08:03 sophgn