Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Compiling Mosquitto client ('pub_client.c') standalone

Hi,
   I downloaded mosquitto-1.4.2. I would like to compile the client, 'pub_client.c', available in  the directory: mosquitto-1.4.2/client  as a standalone.

Here is what I did: "gcc -o pub-client.0  pub_client.c -lmosquitto". But I am getting errors like this:

pub_client.c:(.text+0x5e9): undefined reference to `client_config_load'
pub_client.c:(.text+0x601): undefined reference to `client_config_cleanup'
pub_client.c:(.text+0x655): undefined reference to `client_id_generate'


I also installed the libmosquitto-dev library as follows:

 sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
 sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients libmosquitto-dev


Can you please let me know why I am getting the error?


Thank you.




Back to the top