pebbe / zmq4

A Go interface to ZeroMQ version 4
BSD 2-Clause "Simplified" License
1.17k stars 163 forks source link

Application linking problem #124

Closed omani closed 6 years ago

omani commented 6 years ago

Hi,

I just don't understand how to solve this issue. I tried various versions of libzmq. Basically I am doing this: https://github.com/zeromq/libcurve (see "Building and Installing" section)

Then I get:

2018/01/13 16:56:28 zmq4 was installed with ZeroMQ version 4.2.3, but the application links with version 4.2.4

Where does this 4.2.4 come from? latest (stable) release of libzmq is 4.2.3 afaik.

I also got before:

2018/01/13 15:22:05 zmq4 was installed with ZeroMQ version 4.2.3, but the application links with version 4.1.4

so no matter what version I install. the version this application links to always changes. Thus, I fail to ever satisfy the version dependency.

Any thoughts?

EDIT: Also, I wonder why we check on major AND minor/patch version here. I thought using pebbe's zmq4 (version 4) would just need at least 4.2. So why this strict version checking at all? (at least my current error, version 4.2.4 satisfies this)

omani commented 6 years ago

FYI: After pulling gocode/src/github.com/pebbe/zmq4 now I get:

2018/01/13 17:10:09 zmq4 was installed with ZeroMQ version 4.2.1, but the application links with version 4.2.4

heh.

omani commented 6 years ago

I think pulling the repo changed something. also "rm -rf pkg" in $GOPATH helps (has the same effect).

so basically now I see that 4.2.1 is the zmq version I have installed (which is correct).

however, "the application" still links to 4.2.4.

so the question is: who or what is "the application"? linking to a version which has not been released yet.

pebbe commented 6 years ago

"This application" is the program you are trying to run. It links to a library (on Linux this is probably libzmq.so.5) that is version 4.2.4.

When you did go get github.com/pebbe/zmq4 the header file zmq.h of ZeroMQ was for version 4.2.1.

More info on the need for this version check is here: https://github.com/pebbe/zmq4/pull/123

Since there is no official ZeroMQ 4.2.4, it can never be compatible with another version.

omani commented 6 years ago

Ok I see. so my system has v4.2.4 installed then. I need to check that.

omani commented 6 years ago

ok I've fixed it by doing:

/usr/local/lib  $ ll libzmq.*
-rw-r--r-- 1 root root  27M Jan 13 16:59 libzmq.a
-rwxr-xr-x 1 root root  946 Jan 13 16:59 libzmq.la*
lrwxrwxrwx 1 root root   15 Jan 13 16:59 libzmq.so -> libzmq.so.5.1.1*
lrwxrwxrwx 1 root root   15 Jan 13 16:59 libzmq.so.5 -> libzmq.so.5.1.4*
-rwxr-xr-x 1 root root 8.6M Jan 13 16:59 libzmq.so.5.1.1*
-rwxr-xr-x 1 root root 8.6M Jan 13 16:54 libzmq.so.5.1.2*
-rwxr-xr-x 1 root root 8.8M Jan 13 16:15 libzmq.so.5.1.4*
/usr/local/lib  $ rm libzmq.so.5
rm: cannot remove 'libzmq.so.5': Permission denied
/usr/local/lib  $ sudo rm libzmq.so.5
/usr/local/lib  $ sudo ln -s /usr/local/lib/libzmq.so.5.1.2 /usr/local/lib/libzmq.so.5
/usr/local/lib  $ ll libzmq.*
-rw-r--r-- 1 root root  27M Jan 13 16:59 libzmq.a
-rwxr-xr-x 1 root root  946 Jan 13 16:59 libzmq.la*
lrwxrwxrwx 1 root root   15 Jan 13 16:59 libzmq.so -> libzmq.so.5.1.1*
lrwxrwxrwx 1 root root   30 Jan 13 17:38 libzmq.so.5 -> /usr/local/lib/libzmq.so.5.1.2*
-rwxr-xr-x 1 root root 8.6M Jan 13 16:59 libzmq.so.5.1.1*
-rwxr-xr-x 1 root root 8.6M Jan 13 16:54 libzmq.so.5.1.2*
-rwxr-xr-x 1 root root 8.8M Jan 13 16:15 libzmq.so.5.1.4*
/usr/local/lib  $ 

I guess the former symlink to libzmq.so.5.1.4 was v4.2.4 (guessing because of the 1.4 at the end).

omani commented 6 years ago

thank you for enlightening me pebbe.

Thomas-AnhDao commented 1 year ago

Screenshot 2023-04-05 at 08 24 23 @omani Hi, I change the link file in /usr/local/lib like you but still get this error. Any idea? Here is my error message

E0405 01:30:05.713033    4986 bitcoinrpc.go:169] mq: zmq4 was installed with ZeroMQ version 4.3.5, but the application links with version 4.3.2
E0405 01:30:05.713057    4986 blockbook.go:305] initializeMempool zmq4 was installed with ZeroMQ version 4.3.5, but the application links with version 4.3.2
omani commented 1 year ago

hi @Sotatek-AnhDao , this was 5 years ago. I dont remember anymore :D

but did you go get github.com/pebbe/zmq4 again? after you change the symlink you need to rebuild pebbe's zmq so it knows about the changed header version.

or delete your go.mod and go.sum and go mod tidy again (if you are using go modules instead).