douyiyi5284
2014-06-16 19:32
浏览 440
已采纳

使用go get安装gozmq时出现问题

I was trying to install gozmq with the usual go get:

go get github.com/alecthomas/gozmq

However, I was having the following error:

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

I don't really understand what this error means. Does it mean that its trying to run the command # pkg-config --cflags libzmq libzmq libzmq libzmqand its failing because pkg-config is not on $PATH? What is pkg-config anyway and why do I need it? how do I install it?

I tried brew installing pkg-config but it didn't work and it threw me the following error:

# 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

not sure why that happened.


EDIT:

As the first answerer suggested, I did:

brew install --devel zeromq

however, I get the following error after I do go get github.com/alecthomas/gozmq Error:

# 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'

seem to be "normal" go errors/warning. But they come from a library I got online. I am not sure what to do, if I should fix them myself or what I should to to address it or e-mail the original developers/community or git issue etc.

图片转代码服务由CSDN问答提供 功能建议

我正尝试使用通常的get方法安装gozmq:

 <  code>去获取github.com/alecthomas/gozmq
  
 
 

但是,我遇到了以下错误:

 #pkg-config --cflags libzmq libzmq libzmq libzmq 
exec:“ pkg-config”:在$ PATH 
   
 
 

中找不到可执行文件 了解此错误的含义。 这是否意味着它试图运行命令#pkg-config --cflags libzmq libzmq libzmq libzmq ,并且由于 pkg-config 不在$ PATH上而失败了? 无论如何,什么是 pkg-config ,为什么我需要它? 我如何安装它?

我尝试brew安装pkg-config,但是它不起作用,它引发了以下错误:

 < 代码>#pkg-config --cflags libzmq libzmq libzmq libzmq 
在pkg-config搜索路径中找不到包libzmq。
也许应该将包含`libzmq.pc'
的目录添加到PKG_CONFIG_PATH环境变量
No package' 找到libzmq 
 
在pkg-config搜索路径中没有找到包libzmq。
也许应该将包含`libzmq.pc'的目录添加到PKG_CONFIG_PATH环境变量中
没有找到包'libzmq'
没有找到包libzmq  
也许应该将包含`libzmq.pc'的目录添加到PKG_CONFIG_PATH环境变量中
没有找到包'libzmq'
在pkg-config搜索路径中找不到包libzmq。
也许 应该将包含`libzmq.pc'的目录
添加到PKG_CONFIG_PATH环境变量
未找到包'libzmq'
exit状态1 
   
 
 <  p>不确定为什么会这样。 
 
 

编辑:

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

  brew install --devel zeromq 
   
 
 

,但是,在执行 go后,出现以下错误 github.com/alecthomas/gozmq 错误:

 #github.com/alecthomas/gozmq
37:错误:使用未声明的标识符'ZMQ_SWAP'
37  :错误:使用未声明的标识符'ZMQ_RECOVERY_IVL_MSEC'
37:错误:使用未声明的标识符'ZMQ_MCAST_LOOP'
38:错误:使用未声明的标识符'ZMQ_HWM'
   
 
 

似乎是“正常的”错误/警告。 但是它们来自我上网的图书馆。 我不确定该怎么办,如果我自己修复这些问题或应该解决的问题,或者通过电子邮件将原始的开发人员/社区或git问题发送给我,等等。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douzhuozhu9544 2014-06-16 19:41
    已采纳

    You need to install the development versions of those libraries.

    $ brew install --devel zeromq
    

    According to issue 98, if you're using zeromq v3.x you need to use :

    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
    

    Check the README.

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题