Add paho.mqtt.cpp external library to Castalia

62 views
Skip to first unread message

Sarah ja

unread,
Apr 27, 2023, 7:21:38 AM4/27/23
to Castalia Simulator
Hello,

I am trying to add paho.mqtt.cpp library (witch  needs the  paho.mqtt.c  library) to Castalia.

I have paho.mqtt.cpp library "libpaho-mqttpp3.so "  file in location : "/home/sarah/paho.mqtt.cpp/build/src", and its .h files are in location "/home/sarah/paho.mqtt.cpp/src/mqtt".

And i have paho.mqtt.c library "libpaho-mqtt3as.so "  file in location : "/home/sarah/paho.mqtt.c/build/src", and its .h and .c files are in location "/home/sarah/paho.mqtt.c/src".

I added the line below to makemake file:
EXTOPTS="-I /home/sarah/paho.mqtt.cpp/src/mqtt -L/home/sarah/paho.mqtt.cpp/build/src -lpaho-mqttpp3 -lpaho-mqtt3as"

then run, make clean, ./makemake and make, and it doesn't  give any error.
than i add 
#include "mqtt/client.h"
#include <mqtt/async_client.h>
#include <mqtt/connect_options.h>
#include <mqtt/create_options.h>
#include <mqtt/disconnect_options.h>
to my project file and use it and run make command again but this time it gives errors like this!:

/usr/local/include/mqtt/properties.h:301 : undefined reference to « MQTTProperties_free »
/usr/local/include/mqtt/client.h:173 : undefined reference to « vtable for mqtt::client »
/usr/bin/ld : /usr/local/include/mqtt/client.h:173 : undefined reference to« mqtt::async_client::~async_client() »

Can anyone please help with this?
Regards
Sarah
Reply all
Reply to author
Forward
0 new messages