这个错误查了好久,最后在medium上找到了答案,遂记于此!

系统: mac os

错误信息:

/launchpad.net/gozk/zookeeper/zk.go:15:10: fatal error: ‘zookeeper.h’ file not found

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

...
package zookeeper

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

修改为

...
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/…