zmq4 icon indicating copy to clipboard operation
zmq4 copied to clipboard

Error getting zmq4 Go Binding

Open marioffmarques opened this issue 10 years ago • 32 comments

Hello,

I'm trying to get zmq4 for use with Go (on windows environment) but i'm getting some errors while getting it with command go get "github.com/pebbe/zmq4". Can anyone provide some kind of information about this? And any tips about install zmq4 go binding on windows ?

error1

marioffmarques avatar Apr 23 '15 10:04 marioffmarques

I am running into the same issue on Ubuntu..

Dipsingh avatar Sep 17 '16 03:09 Dipsingh

go zmq4 needs the zeromq shared library. Linux needs the /usr/local/lib/libzmq.so and Windows needs a *.dll . The above message indicates the library cannot be found. Either the shared library is not installed, or it's in a location where zmq4 cannot find it.

aletheia7 avatar Sep 17 '16 07:09 aletheia7

Thanks. I have "/usr/local/lib/libzmq.so" in my linux. I have poked around few other threads to see what could be wrong but had no luck so far..

On Sat, Sep 17, 2016 at 2:11 AM, aletheia7 [email protected] wrote:

go zmq4 needs the zeromq shared library. Linux needs the /usr/local/lib/libzmq.so and Windows needs a *.dll . The above message indicates the library cannot be found. Either the shared library is not installed, or it's in a location where zmq4 cannot find it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247754438, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4U7CSzKozKPvOAL-SC6pbwpbCy7Eyks5qq5KogaJpZM4EG1l9 .

Dipsingh avatar Sep 17 '16 15:09 Dipsingh

After you completed configure, make, make install, did you run ldconfig as root?

aletheia7 avatar Sep 17 '16 20:09 aletheia7

Yup.. Followed the below instructions...

git clone https://github.com/zeromq/libzmq ./autogen.sh && ./configure && make -j 4 make check && make install && sudo ldconfig

Just for the sake of trying to see if it makes any difference, I also tried this installing it in "/usr" as well by supplying the prefix /usr while running "configure". Let me know if you need any other details and I can provide it.

On Sat, Sep 17, 2016 at 3:26 PM, aletheia7 [email protected] wrote:

After you completed configure, make, make install, did you run ldconfig as root?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247805636, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4U-syQh03s1L2VchO4VO5waqI8kg_ks5qrEzmgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 02:09 Dipsingh

  1. Do you see /usr/local/include/zmq.h?
  2. Do you see /usr/local/lib/pkgconfig/libzmq.pc?
  3. Are the paths correct in libzmq.pc?

try git clone https://github.com/zeromq/zeromq4-1

aletheia7 avatar Sep 18 '16 02:09 aletheia7

Be sure to perform git checkout -b v4.1.5 after cloning https://github.com/zeromq/zeromq4-1

aletheia7 avatar Sep 18 '16 02:09 aletheia7

Must be root for make install

aletheia7 avatar Sep 18 '16 02:09 aletheia7

  1. Do you see /usr/local/include/zmq.h? Yes
  2. Do you see /usr/local/lib/pkgconfig/libzmq.pc? Yes
  3. Are the paths correct in libzmq.pc? seems right ..below is the output

more /usr/local/lib/pkgconfig/libzmq.pc prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include

Name: libzmq Description: 0MQ c++ library Version: 4.1.5 Libs: -L${libdir} -lzmq Cflags: -I${includedir}

On Sat, Sep 17, 2016 at 9:51 PM, aletheia7 [email protected] wrote:

  1. Do you see /usr/local/include/zmq.h?
  2. Do you see /usr/local/lib/pkgconfig/libzmq.pc?
  3. Are the paths correct in libzmq.pc?

try git clone https://github.com/zeromq/zeromq4-1

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247821266, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4UzWjMyvXiZ5SRFCS4ln06O5DieLrks5qrKdLgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 03:09 Dipsingh

Thanks. Let me give it a try..

On Sat, Sep 17, 2016 at 9:56 PM, aletheia7 [email protected] wrote:

Must be root for make install

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247821429, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4UwHBAxKQIOCe1FLce-cpDXw98Vo_ks5qrKhhgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 03:09 Dipsingh

Okay, so here is what I tried. I am not sure what am I missing..

  • git clone https://github.com/zeromq/zeromq4-1
  • cd zeromq4-1/
  • git checkout -b v4.1.5
  • ./autogen.sh
  • ./configure
  • make
  • sudo make install
  • sudo ldconfig

After this I ran the code again "go run zmq.go"

command-line-arguments

/home/dipsingh/Desktop/GOPROJECT/src/github.com/pebbe/zmq4/errors.go:30: error: undefined reference to 'zmq_strerror' /home/dipsingh/Desktop/GOPROJECT/src/github.com/pebbe/zmq4/polling.go:30: error: undefined reference to 'zmq_poll' /home/dipsingh/Desktop/GOPROJECT/src/github.com/pebbe/zmq4/polling.go:36: error: undefined reference to 'zmq_poll' /home/dipsingh/Desktop/GOPROJECT/src/github.com/pebbe/zmq4/socketget.go:32: error: undefined reference to 'zmq_getsockopt' /home/dipsingh/Desktop/GOPROJECT/src/github.com/pebbe/zmq4/socketget.go:38: error: undefined reference to 'zmq_getsockopt' /home/dipsingh/Desktop/GOPROJECT/src/github.com/pebbe/zmq4/socketset.go:33: error: undefined reference to 'zmq_setsockop" <Output Omitted for brevity> collect2: error: ld returned 1 exit status

On Sat, Sep 17, 2016 at 9:56 PM, aletheia7 [email protected] wrote:

Must be root for make install

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247821429, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4UwHBAxKQIOCe1FLce-cpDXw98Vo_ks5qrKhhgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 03:09 Dipsingh

Do you have pkg-config installed? apt-get install pkg-config

aletheia7 avatar Sep 18 '16 04:09 aletheia7

Yeah i have pkg-config installed.

pkg-config --version 0.26

On Sat, Sep 17, 2016 at 11:31 PM, aletheia7 [email protected] wrote:

Do you have pkg-config installed? apt-get install pkg-config

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247824810, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4U34nzziTmV_Kjwp7Np9ncYmTMqxXks5qrL6LgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 04:09 Dipsingh

Do you have the Ubuntu libzmq* package installed?

dpkg-query -l libzmq\*

aletheia7 avatar Sep 18 '16 04:09 aletheia7

This is what i have.

dpkg-query -l libzmq* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-====================================-=======================-=======================-============================================================================== ii libzmq-dev:amd64 2.2.0+dfsg-5 amd64 lightweight messaging kernel (development files) ii libzmq1:amd64 2.2.0+dfsg-5 amd64 lightweight messaging kernel (shared library)

On Sat, Sep 17, 2016 at 11:44 PM, aletheia7 [email protected] wrote:

Do you have the Ubuntu libzmq* package installed?

dpkg-query -l libzmq*

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247825209, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4U4Nl6FxDr-qyoqaOwd1tKtXg5Z65ks5qrMGYgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 04:09 Dipsingh

Those are old libraries. Do you want to remove them? If you remove them, other things might also be removed. What version of Ubuntu? lsb_release -a

apt-get remove libzmq-dev:amd64 libzmq:amd64

aletheia7 avatar Sep 18 '16 04:09 aletheia7

Yeah i can remove them, which ones i need to look for ? ..its a test box

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty

On Sat, Sep 17, 2016 at 11:51 PM, aletheia7 [email protected] wrote:

Those are old libraries. Do you want to remove them? If you remove them, other things might also be removed. What version of Ubuntu? lsb_release -a

apt-get remove libzmq-dev:amd64 libzmq:amd64

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247825423, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4U4Re8d2K31gJ-LXx8CG1XvUQFtVwks5qrMNagaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 04:09 Dipsingh

Run the apt-get remove above. Run ldconfig. Try configure, make, make install, ldconfig again.

aletheia7 avatar Sep 18 '16 04:09 aletheia7

Try configure, make, make install, ldconfig again just to clarify, run above commands on zeromq ?

On Sat, Sep 17, 2016 at 11:54 PM, aletheia7 [email protected] wrote:

Run the apt-get remove above. Run ldconfig. Try configure, make, make install, ldconfig again.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247825513, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4U4GVg2Hu_-wDDn-qopg7irlP3eR_ks5qrMQegaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 04:09 Dipsingh

Yes.

aletheia7 avatar Sep 18 '16 04:09 aletheia7

removed the package, ran "sudo ldconfig". Then I ran the configure,make, sudo make install and sudo ldconfig but no luck ..ran into the same error ..Thanks for helping me so far..

dpkg-query -l libzmq* dpkg-query: no packages found matching libzmq*

On Sat, Sep 17, 2016 at 11:57 PM, aletheia7 [email protected] wrote:

Yes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247825619, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4U9CmbJ7-0rnXrHGPPUYRHmvDEVPBks5qrMTWgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 05:09 Dipsingh

You're welcome. What is the output of type pkg-config

aletheia7 avatar Sep 18 '16 05:09 aletheia7

Here is the output

type pkg-config pkg-config is /usr/bin/pkg-config

On Sun, Sep 18, 2016 at 12:06 AM, aletheia7 [email protected] wrote:

You're welcome. What is the output of type pkg-config

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247825866, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4UwMXy5_7bz_OkXakIo9TWYfuueX0ks5qrMbcgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 05:09 Dipsingh

What is the output of go env

aletheia7 avatar Sep 18 '16 05:09 aletheia7

go env GOARCH="amd64" GOBIN="" GOCHAR="6" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/dipsingh/Desktop/GOPROJECT" GORACE="" GOROOT="/usr" GOTOOLDIR="/usr/lib/gccgo/tool" TERM="dumb" CC="gcc" GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread" CXX="g++" CGO_ENABLED="1"

On Sun, Sep 18, 2016 at 12:10 AM, aletheia7 [email protected] wrote:

What is the output of go env

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247825993, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4Uyx-n871BHcsNcWOS1zm5nk3iZ8dks5qrMfLgaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 05:09 Dipsingh

  1. Did you compile go from source?
  2. What is the output from dpkg-query -l go\*

aletheia7 avatar Sep 18 '16 05:09 aletheia7

Go is normally installed under /usr/lib/go.

aletheia7 avatar Sep 18 '16 05:09 aletheia7

  1. Did you compile go from source? Honestly don't recall, but I don't think I compiled it..
  2. What is the output from dpkg-query -l go*

dpkg-query -l go* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait /Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-====================================-=======================-=======================-============================================================================== un go-compiler (no description available) un gobject-introspection-freedesktop (no description available) un gobject-introspection-glib-2.0 (no description available) un gobject-introspection-repository (no description available) un golang-go (no description available)

On Sun, Sep 18, 2016 at 12:13 AM, aletheia7 [email protected] wrote:

  1. Did you compile go from source?
  2. What is the output from dpkg-query -l go*

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247826088, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4UzFKV8FcOduumyx4ZCwWlxJwqpe3ks5qrMh2gaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 05:09 Dipsingh

Alright ..Now I can bang my head in the wall..I just pulled golang packages again and it worked ...

Gezzz..

On Sun, Sep 18, 2016 at 12:16 AM, dip [email protected] wrote:

  1. Did you compile go from source? Honestly don't recall, but I don't think I compiled it..
  2. What is the output from dpkg-query -l go*

dpkg-query -l go* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait /Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-====================================-===================

====-=======================-===============================

un go-compiler (no description available) un gobject-introspection-freedesktop (no description available) un gobject-introspection-glib-2.0 (no description available) un gobject-introspection-repository (no description available) un golang-go (no description available)

On Sun, Sep 18, 2016 at 12:13 AM, aletheia7 [email protected] wrote:

  1. Did you compile go from source?
  2. What is the output from dpkg-query -l go*

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pebbe/zmq4/issues/45#issuecomment-247826088, or mute the thread https://github.com/notifications/unsubscribe-auth/AKF4UzFKV8FcOduumyx4ZCwWlxJwqpe3ks5qrMh2gaJpZM4EG1l9 .

Dipsingh avatar Sep 18 '16 05:09 Dipsingh

Great. What is your go version: go version

Your version of Ubuntu is getting quite old. You should upgrade.

I ran Ubuntu of years. Ubuntu's upstream is Debian. I prefer Debian Stretch/Testing with XFCE Desktop over Ubuntu.

aletheia7 avatar Sep 18 '16 05:09 aletheia7