Skip to content

Unable to build on M1 ARM Mac #188

Open
@jacobkring

Description

Installed zeromq using brew and using go1.18.4

brew install pkg-config zeromq

➜ pkg-config --modversion libzmq
4.3.4
➜ go env CGO_ENABLED
1

Tried to build a package that imports "github.com/pebbe/zmq4"

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
Undefined symbols for architecture x86_64:
  "_zmq_bind", referenced from:
      _zmq4_bind in _x009.o
  "_zmq_close", referenced from:
      _zmq4_close in _x009.o
  "_zmq_connect", referenced from:
      _zmq4_connect in _x009.o
  "_zmq_ctx_get", referenced from:
      _zmq4_ctx_get in _x009.o
  "_zmq_ctx_new", referenced from:
      _zmq4_ctx_new in _x009.o
  "_zmq_ctx_set", referenced from:
      _zmq4_ctx_set in _x009.o
  "_zmq_ctx_term", referenced from:
      _zmq4_ctx_term in _x009.o
  "_zmq_curve_keypair", referenced from:
      _zmq4_curve_keypair in _x009.o
  "_zmq_curve_public", referenced from:
      _zmq4_curve_public in _x009.o
  "_zmq_disconnect", referenced from:
      _zmq4_disconnect in _x009.o
  "_zmq_getsockopt", referenced from:
      _zmq4_getsockopt in _x009.o
  "_zmq_has", referenced from:
      __cgo_623c834d1dc5_Cfunc_zmq_has in _x010.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_has)
  "_zmq_msg_close", referenced from:
      __cgo_623c834d1dc5_Cfunc_zmq_msg_close in _x010.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_msg_close)
  "_zmq_msg_data", referenced from:
      _zmq4_get_event40 in _x010.o
      _zmq4_get_event41 in _x010.o
      __cgo_623c834d1dc5_Cfunc_zmq4_get_event40 in _x010.o
      __cgo_623c834d1dc5_Cfunc_zmq4_get_event41 in _x010.o
      __cgo_623c834d1dc5_Cfunc_zmq_msg_data in _x010.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_msg_data)
  "_zmq_msg_gets", referenced from:
      _zmq4_msg_gets in _x009.o
  "_zmq_msg_init", referenced from:
      __cgo_623c834d1dc5_Cfunc_zmq_msg_init in _x010.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_msg_init)
  "_zmq_msg_recv", referenced from:
      _zmq4_msg_recv in _x009.o
  "_zmq_poll", referenced from:
      _zmq4_poll in _x009.o
  "_zmq_proxy", referenced from:
      _zmq4_proxy in _x009.o
  "_zmq_proxy_steerable", referenced from:
      _zmq4_proxy_steerable in _x009.o
  "_zmq_send", referenced from:
      _zmq4_send in _x009.o
  "_zmq_setsockopt", referenced from:
      _zmq4_setsockopt in _x009.o
  "_zmq_socket", referenced from:
      _zmq4_socket in _x009.o
  "_zmq_socket_monitor", referenced from:
      _zmq4_socket_monitor in _x009.o
  "_zmq_strerror", referenced from:
      __cgo_623c834d1dc5_Cfunc_zmq_strerror in _x004.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_strerror)
  "_zmq_unbind", referenced from:
      _zmq4_unbind in _x009.o
  "_zmq_version", referenced from:
      __cgo_623c834d1dc5_Cfunc_zmq_version in _x010.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_version)
  "_zmq_z85_decode", referenced from:
      __cgo_623c834d1dc5_Cfunc_zmq_z85_decode in _x010.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_z85_decode)
  "_zmq_z85_encode", referenced from:
      __cgo_623c834d1dc5_Cfunc_zmq_z85_encode in _x010.o
     (maybe you meant: __cgo_623c834d1dc5_Cfunc_zmq_z85_encode)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am I missing a dependency or have I gone wrong somewhere in configuring things? Would appreciate any push in the right direction.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions