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

使用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.

  • 写回答

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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog