old client library on Raspberry Pi

Asked by merlin13

I looked around but couldn't find an answer to my question, I apologize in advance if the question is silly or the answer is already present somewhere.

I am a beginner with mosquitto and I'd like to write some simple publish code on my Raspberry Pi, using C. I installed libmosquitto0-dev (which is the 3.1 client library according to the description), included mosquitto.h in my code and started looking through the example code here http://mosquitto.org/man/libmosquitto-3.html. Unfortunately, it seems the methods in the library I installed don't match the example code: mosquitto_new() takes only 2 args, callback functions don't take a first struct mosq argument, mosquitto_publish() seems to have a different list of args.

I assume the libmosquitto version I got is either older or newer. I can try to figure it out but it would be great if I could find some docs for this version. I looked on github but can't find anything where mosquitto.h defines a mosquitto_new() with just 2 args and I am a bit stuck.

Is the documentation for this version somewhere? Preferably with some example code as well?

Thanks in advance for all your help!

Question information

Language:
English Edit question
Status:
Solved
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Solved by:
merlin13
Solved:
Last query:
Last reply:
Revision history for this message
Roger Light (roger.light) said :
#1

I'd recommend you just upgrade to the latest version. Unfortunately I can't influence what is in the raspbian repositories, but you can use the mosquitto repository as described here: http://mosquitto.org/2013/01/mosquitto-debian-repository/

Revision history for this message
merlin13 (claudiuo) said :
#2

Thank you so much, I somehow missed the debian repo page. I will do so.