cannot run zeromq in go on mac apple m1

Viewed 14

I am working on zeromq in go in this link: https://zeromq.org/languages/go/.

I did following:

  1. go mod init dailyPractice
  2. go mod tidy
  3. Installed zeromq with "brew install zeromq"
  4. go run main.go

go.mod file is as follows:

module dailyPractice

go 1.18

require github.com/zeromq/goczmq v4.1.0+incompatible

but once I run main.go

It shows the error message as follows:

# github.com/zeromq/goczmq
ld: warning: ignoring file /opt/homebrew/Cellar/zeromq/4.3.4/lib/libzmq.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/czmq/4.2.1/lib/libczmq.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/libsodium/1.0.18_1/lib/libsodium.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_zactor_destroy", referenced from:
      __cgo_10ace123587a_Cfunc_zactor_destroy in _x002.o
     (maybe you meant: __cgo_10ace123587a_Cfunc_zactor_destroy)
  "_zactor_new", referenced from:
      _Auth_new in _x002.o
      __cgo_10ace123587a_Cfunc_Auth_new in _x002.o
      _Beacon_new in _x003.o
      __cgo_10ace123587a_Cfunc_Beacon_new in _x003.o
      _Zproxy_new in _x009.o
      __cgo_10ace123587a_Cfunc_Zproxy_new in _x009.o
  "_zauth", referenced from:
      _Auth_new in _x002.o
      __cgo_10ace123587a_Cfunc_Auth_new in _x002.o
  "_zbeacon", referenced from:
      _Beacon_new in _x003.o
......

I also tried using pebbe/zmq4, but the error is almost the same. I am using mac Apple M1, I found a similar post: https://github.com/hyperledger/indy-sdk/issues/2393 and tried their solution, but did not work.

thanks

0 Answers
Related