cat
cat copied to clipboard
go客户端go get报错
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版本问题么?
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