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)
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 usinggcc -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 inmosquitto.h
file but not able to use functions declared inmosquitto_broker.h
(likemosquitto_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)