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

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

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

但是,我遇到了以下错误:</ p>

 #pkg-config --cflags libzmq libzmq libzmq libzmq 
exec:“ pkg-config”:在$ PATH
</ code> </ pre>

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

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

 < 代码>#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
</ code> </ pre>

< p>不确定为什么会这样。</ p>


编辑:</ p>

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

  brew install --devel zeromq 
</ code> </ pre>

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

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

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

展开原文

原文

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个回答



您需要安装这些库的开发版本。</ p>

  $ brew install  --devel zeromq 
</ code> </ pre>

根据 问题98 ,如果您使用的是 zeromq v3.x </ code>,则需要使用:</ p>

  go get -tags zmq_3_x github.com  / alecthomas / gozmq 
#,或者如果您使用的是4x
go get -tags zmq_4_x github.com/alecthomas/gozmq
</ pre>

检查自述文件。</ p>
</ div>

展开原文

原文

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.

doulangpeng3933
doulangpeng3933 我不知道,我从未使用过它。
大约 6 年之前 回复
dqjo4340
dqjo4340 它确实提到在第98期(github.com/alecthomas/gozmq/issues/98)中,版本4可能不起作用。 有没有办法使用自制软件安装特定版本?
大约 6 年之前 回复
dtnpzghys01643322
dtnpzghys01643322 “在pkg-config搜索路径中找不到软件包libzmq。” 意味着Zeromq软件包尚未安装在您的计算机上,因此您只需要安装它即可,现在查找只是谷歌搜索的问题,还请检查我刚刚发布的更新。
大约 6 年之前 回复
dsm17496
dsm17496 最后一个问题,我怎么应该知道我应该做brew install --devel zeromq来修复错误?
大约 6 年之前 回复
dongyue934001
dongyue934001 这似乎是软件包本身中的一个错误,请在其github问题跟踪器中报告该错误。
大约 6 年之前 回复
douzen1880
douzen1880 我想我安装成功了吗? 但这让我感到#github.com/alecthomas/gozmq 37:错误:使用未声明的标识符'ZMQ_SWAP'37:错误:使用未声明的标识符'ZMQ_RECOVERY_IVL_MSEC'37:错误:使用未声明的标识符'ZMQ_MCAST_LOOP'38:错误:使用 未声明的标识符'ZMQ_HWM'`正常吗? 我应该担心吗? 我如何测试是否确实安装了?
大约 6 年之前 回复
douji6896
douji6896 这是zeromq不是libzmq,我不好。
大约 6 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问