1

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?

Charlie Parker
  • 13,522
  • 35
  • 118
  • 206
  • 2
    possible duplicate of [How do I fix 'brew install pkg-config'?](http://stackoverflow.com/questions/13483059/how-do-i-fix-brew-install-pkg-config) – OneOfOne Aug 19 '14 at 02:10
  • 1
    that is very similar. Wonder why it didn't come up when I searched, thanks for the link I will take a look at it for sure – Charlie Parker Aug 19 '14 at 02:11
  • 1
    I googled for **brew pkg-config**, SO's search is usually useless 99% of the time. – OneOfOne Aug 19 '14 at 02:13
  • 2
    @Pinocchio: It's complaining that it can't find `pkg-config` in your `$PATH`. Have you installed `pkg-config`? – peterSO Aug 19 '14 at 02:16

1 Answers1

4

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.

Community
  • 1
  • 1
Charlie Parker
  • 13,522
  • 35
  • 118
  • 206