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

这个错误查了好久,最后在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/…

    原文作者:SkyWay
    原文地址: https://segmentfault.com/a/1190000007518559
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞