eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.61k stars 2.33k forks source link

Undefined symbols `_mosquitto_callback_register`, `_mosquitto_callback_unregister` #3025

Open shyamsingla11 opened 3 months ago

shyamsingla11 commented 3 months ago

I am trying to build a custom v5 auth plugin, so i have started by looking at the code of message-timestamp plugin (available in plugins directory). But on building the plugin i am getting the following errors: Undefined symbols for architecture x86_64: "_mosquitto_callback_register", referenced from: _mosquitto_plugin_init in mosquitto_auth_acl_plugin-512511.o "_mosquitto_callback_unregister", referenced from: _mosquitto_plugin_cleanup in mosquitto_auth_acl_plugin-512511.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I am trying this with the mosquitto v2.0.18 Build command i am using gcc -shared -fPIC -o mosquitto_auth_acl_plugin.so mosquitto_auth_acl_plugin.c -L/usr/local/Cellar/mosquitto/2.0.18/lib -lmosquitto I did a little investigation and found that i am able to use the functions declared in mosquitto.h file but not able to use functions declared in mosquitto_broker.h (like mosquitto_callback_register , mosquitto_callback_unregister ) I have checked there is a similar issue reported here -> #2514 (i haven't checked this in develop branch yet as i wanted to use my plugin in production with the current version of mosquitto)