Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Linking C shared module mosquitto_message_timestamp.so failed in MacOS

Hi Roger,

Thanks for the response. Commented out the message_timestamp and it worked!
I also had to disable docbook, dynamic-security and payload-modification to pass the build. 

If only add the "target_link_libraries" line to the CMakeLists.txt, I still got the other error:
-- WITH_DLT = OFF
-- Found cJSON: /usr/local/include  
-- TRUE
CMake Error at plugins/message-timestamp/CMakeLists.txt:5 (target_link_libraries):
  Target "mosquitto" of type EXECUTABLE may not be linked into another
  target.  One may link only to INTERFACE, OBJECT, STATIC or SHARED
  libraries, or to executables with the ENABLE_EXPORTS property set.


-- Configuring incomplete, errors occurred!


Thanks,
Luke



On Fri, Sep 3, 2021 at 3:54 AM Roger Light <roger@xxxxxxxxxx> wrote:
Hi Luke,

Could you try adding the following line to
plugins/message-timestamp/CMakeLists.txt after the add_library line
please?

target_link_libraries(mosquitto_message_timestamp mosquitto)

Alternatively, comment out the message-timestamp line in
plugins/CMakeLists.txt, it's only an example plugin.

Regards,

Roger

On Fri, 3 Sept 2021 at 02:55, Luke Chen <lchen.dev@xxxxxxxxx> wrote:
>
> Hi,
>
> I tried to build mosquitto v2.0.12 in MacOS Big Sur (version 11.5.2) with the following steps but failed with the following error message:
>
>
> mosquitto % cmake -Bbuild
>
> ...
>
> ...
>
> -- Build files have been written to: /Users/lchen/git/mosquitto/build
>
>
> mosquitto % cmake --build build
>
> ...
>
> ...
>
> [ 91%] Building C object plugins/message-timestamp/CMakeFiles/mosquitto_message_timestamp.dir/mosquitto_message_timestamp.c.o
>
> [ 91%] Linking C shared module mosquitto_message_timestamp.so
>
> Undefined symbols for architecture x86_64:
>
>   "_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 x86_64
>
> 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
>
>
>
> Any help?
>
>
> Thanks,
>
> Luke
>
>
>
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top