PlotJuggler / plotjuggler-mqtt

MIT License
11 stars 0 forks source link

Eclipse Paho MQTT shared-object library not found when launching libDataStreamMQTT #2

Closed ashishraste closed 2 years ago

ashishraste commented 2 years ago

Hi @facontidavide,

Thanks for developing this plugin. Please find below the description for the issue.

Issue Description

OS - Ubuntu 20.04 Compiler - Clang (version 10.0)

When launching plotjuggler (built from source, launched from command-line), libDataStreamMQTT.so is not able to fully load libpaho-mqtt-3c.so.1.

Option 1

libDataStreamMQTT plugin installed in /usr/local/bin via sudo make install route. Log below shows the output when plotjuggler is launched.

Loading compatible plugins from directory: "/usr/local/bin" "libDataLoadCSV.so is a DataLoader plugin" "libDataLoadULog.so is a DataLoader plugin" "libDataStreamMQTT.so" : "Cannot load library /usr/local/bin/libDataStreamMQTT.so: (libpaho-mqtt3c.so.1: cannot open shared object file: No such file or directory)" "libDataStreamSample.so is a DataStreamer plugin" ...disabled, unless option -t is used "libDataStreamUDP.so is a DataStreamer plugin" "libDataStreamWebSocket.so is a DataStreamer plugin" "libProtobufParser.so is a MessageParser plugin" "libPublisherCSV.so is a StatePublisher plugin" QtAV 1.13.0(Apr 10 2020, 19:10:20) Multimedia framework base on Qt and FFmpeg. Distributed under the terms of LGPLv2.1 or later. Shanghai, China Copyright (C) 2012-2019 Wang Bin (aka. Lucas Wang) wbsecg1@gmail.com Donate: http://qtav.org/donate.html Source: https://github.com/wang-bin/QtAV Home page: http://qtav.org "libPublisherVideoViewer.so is a StatePublisher plugin" Type conversion already registered from type QString to type QwtText "libToolboxFFT.so is a MessageParser plugin" Type conversion already registered from type QString to type QwtText "libToolboxQuaternion.so is a MessageParser plugin" Number of plugins loaded: 9

Note: plotjuggler-mqtt was built, with a slight change in its dependency cmake script as mentioned here.

Option 2

build directory of plotjuggler-mqtt containing libDataStreamMQTT.so added to PlotJuggler via App -> Preferences route. ldd on the shared object shows the correct path to libpaho-mqtt3c.so.1, but a symbol error stops it from being loaded. Relevant log below from running plotjuggler

Loading compatible plugins from directory: "/home/ubuntu/plotjuggler-mqtt/build" "libDataStreamMQTT.so" : "Cannot load library /home/ubuntu/plotjuggler-mqtt/build/libDataStreamMQTT.so: (/home/ubuntu/plotjuggler-mqtt/build/libDataStreamMQTT.so: undefined symbol: _ZN2PJ12DataStreamer16staticMetaObjectE)" Number of plugins loaded: 0

Question

I noticed that when using Clang as the CMake C/C++ compiler, the shared object paho-mqtt3c is correctly referenced in CMakeLists and in the library object that is built. Do you have any idea as to why it's not linked, or rather installed together, with libDataStreamMQTT?

facontidavide commented 2 years ago

I am not going to maintain that plugin anymore. The official one uses Mosquito