/gozk/zookeeper/zk.go fatal error: zookeeper.h file not found

這個錯誤查了很久,最後在medium上找到了答案,遂記於此!api

系統: mac osui

錯誤信息:.net

/launchpad.net/gozk/zookeeper/zk.go:15:10: fatal error: 'zookeeper.h' file not foundcode

solution:
文件$GOPATH/src/launchpad.net/gozk/zookeeper/zk.goip

...
package zookeeper

/*
#cgo CFLAGS: -I/usr/include/c-client-src -I/usr/include/zookeeper
#cgo LDFLAGS: -lzookeeper_mt
...

修改成ci

...
package zookeeper

/*
#cgo CFLAGS: -I/usr/include/c-client-src -I/usr/include/zookeeper -I/usr/local/include/zookeeper
#cgo LDFLAGS: /usr/local/lib/libzookeeper_mt.a
...

參考:https://medium.com/@robiplus/...get

相關文章
相關標籤/搜索