Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build on Mac with M1 chip. #2744

Open
aryanLandi opened this issue Feb 3, 2023 · 4 comments
Open

Cannot build on Mac with M1 chip. #2744

aryanLandi opened this issue Feb 3, 2023 · 4 comments

Comments

@aryanLandi
Copy link

Building the latest mosquitto source code results in the following linker error on a Mac with the Apple M1 chip.

Undefined symbols for architecture arm64:
  "_mosquitto_callback_register", referenced from:
      _mosquitto_plugin_init in mosquitto_message_timestamp.c.o
  "_mosquitto_callback_unregister", referenced from:
      _mosquitto_plugin_cleanup in mosquitto_message_timestamp.c.o
  "_mosquitto_property_add_string_pair", referenced from:
      _callback_message in mosquitto_message_timestamp.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [plugins/message-timestamp/mosquitto_message_timestamp.so] Error 1
make[1]: *** [plugins/message-timestamp/CMakeFiles/mosquitto_message_timestamp.dir/all] Error 2
make: *** [all] Error 2
@NorbertHeusser
Copy link
Contributor

On which branch did you test to compile the code ?

We fixed the cmake based build for the M1 Mac on the develop branch some time ago. Will be available on the master branch with the next major release.

@aryanLandi
Copy link
Author

aryanLandi commented Feb 16, 2023

@NorbertHeusser Indeed I builded mosquitto from the master branch. After checking out the develop branch I had to install 2 more dependencies (CUnit and uthash). However, I can now confirm that the develop branch gives similar errors.

Undefined symbols for architecture arm64:
  "_mosquitto_callback_register", referenced from:
      _mosquitto_plugin_init in mosquitto_limit_subscription_qos.c.o
  "_mosquitto_plugin_set_info", referenced from:
      _mosquitto_plugin_init in mosquitto_limit_subscription_qos.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [plugins/examples/limit-subscription-qos/mosquitto_limit_subscription_qos.so] Error 1
make[1]: *** [plugins/examples/limit-subscription-qos/CMakeFiles/mosquitto_limit_subscription_qos.dir/all] Error 2
make: *** [all] Error 2

@ryandesign
Copy link

See proposed solution in #2858 (comment)

@BB-301
Copy link

BB-301 commented Oct 24, 2023

@ryandesign ,

See proposed solution in #2858 (comment)

The proposed solution worked for me. Thank you!

I was having a similar problem while trying to build master tag v2.0.18 on macOS Ventura 13.2 (Intel).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants