doujia7094 2014-08-19 02:05
浏览 316
已采纳

无法在Mac OS X上为Golang运行zmq,未知问题

I was trying to use gozmq for my go project with ZMQ however, I was having some problems and wasn't really sure what the problem was.

When I run my application with zmq as in:

$ go run main.go

I get back:

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

I don't actually know what it means or why it comes up. However, I guessed that I didn't install zmq or it cannot find it or something...so I brew installed it with

brew install zmq

But I get:

Warning: zeromq-4.0.4 already installed

So I know that I already installed it. Even though its installed it doesn't work, weird?

The instruction at gozmq do say to run for 4.x install with:

go get -tags zmq_4_x github.com/alecthomas/gozmq

I literally ran:

go get -tags zmq_4_x github.com/alecthomas/gozmq

and

go get -tags zmq_4_0 github.com/alecthomas/gozmq

and

go get -tags zmq_4_0_4 github.com/alecthomas/gozmq

I thought the last one would work since it matches the version I had but non of the above worked.

In fact they all just returned the familiar error:

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

As a last resource I tried to go to (the official site) at:

http://zeromq.org/docs:source-git

to install it but the instruction they have for MAC OS X and Unix-like systems does not work for my computer. Does anyone know whats going on? What else should I try?

  • 写回答

1条回答 默认 最新

  • douxu4610 2014-08-19 02:57
    关注

    The problem for pkg-config was easy to solve. I just brew installed it as the duplicate suggested.

    However,if you look a little closer, I had 4.0.4. Which seems to be a version of zmq that is not properly supported by gozmq (or it doesn't work because it has errors thrown by the compiler).

    I had to then go and brew install zmq but version 3.2.4 and then install the gozmq version for that zmq version.

    To do that read Homebrew install specific version of formula? that shows you how to install a specific version of anything in brew.

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

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化