Multiple libraries (pubsubclient)

Hi,

With an Arduino UNO and an Ethernet shield I wrote several applications to connect to a MQTT broker (3.1.1) using the knolleary pubsubclient library, all works fine!

Now I would like to compile ESPEASY using the same IDE (1.6.5) but got compilation problems because of the pubsubclient used in ESPEASY is different then the one I used before.

Is there a way to have both libraries installed while the compiler uses the correct library ?

A solution might be to place the library in the same directory where the sketch is stored, this way you could also use different versions of same libraries with different sketches.

Or are better solutions available?

-ben

Is there a way to have both libraries installed while the compiler uses the correct library ?

How will the compiler know which of two libraries with the same name is the "correct" one?

bennyb: A solution might be to place the library in the same directory where the sketch is stored, this way you could also use different versions of same libraries with different sketches.

Yes that will work. Just change the includes to something like:

#include "PubSubClient/PubSubClient.h"

bennyb: Or are better solutions available?

You could also change the name of one of the libraries. That would probably be the better option if you wanted to use the library in multiple sketches.

Thanks for anyone who replied:

I've solved the problem differently and made 2 (portable ) versions of 1.6.5 :

One for 'normal' work and One dedicated for compiling ESPEasy

-ben