安装gozmq时出现问题

时间:2014-06-16 19:32:42

标签: go install

我试图用通常的go get:

安装gozmq
go get github.com/alecthomas/gozmq

但是,我遇到以下错误:

# pkg-config --cflags libzmq libzmq libzmq libzmq
exec: "pkg-config": executable file not found in $PATH

我真的不明白这个错误意味着什么。这是否意味着它试图运行命令# pkg-config --cflags libzmq libzmq libzmq libzmq并且失败,因为pkg-config不在$ PATH上?什么是pkg-config,为什么我需要它?我该如何安装?

我尝试brew安装pkg-config但它没有工作,它给我发了以下错误:

# pkg-config --cflags libzmq libzmq libzmq libzmq
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
exit status 1

不确定为什么会这样。


编辑:

正如第一个回答者建议的那样,我做了:

brew install --devel zeromq

然而,在go get github.com/alecthomas/gozmq之后我收到以下错误 错误:

# github.com/alecthomas/gozmq
37: error: use of undeclared identifier 'ZMQ_SWAP'
37: error: use of undeclared identifier 'ZMQ_RECOVERY_IVL_MSEC'
37: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'
38: error: use of undeclared identifier 'ZMQ_HWM'

似乎"正常"去错误/警告。但他们来自我上网的图书馆。我不知道该怎么办,我是否应该自己解决这些问题,或者我应该如何解决它,或者通过电子邮件发送原始开发者/社区或git问题等。

1 个答案:

答案 0 :(得分:6)

您需要安装这些库的开发版本。

$ brew install --devel zeromq

根据issue 98,如果您正在使用zeromq v3.x,则需要使用:

go get -tags zmq_3_x github.com/alecthomas/gozmq
# or if you're using 4x 
go get -tags zmq_4_x github.com/alecthomas/gozmq

检查README