Q about #include and library folder

greets,

is there a shorter way to include a library that's located in the same folder as the sketch?

e.g. I have now:

#include "E:\DIY\Arduino Folder\LCD_Simple_Test\LiquidCrystal_I2C\LiquidCrystal_I2C.h"

#include "E:\DIY\Arduino Folder\LCD_Simple_Test\LiquidCrystal_I2C\LiquidCrystal_I2C.cpp"

Is there a way to have something like this pseudo code (not working):

#include "...\LiquidCrystal_I2C.h"

#include "...\LiquidCrystal_I2C.cpp"

this way I can move the folder to another folder or pc.

thanks!

#include "xyz.h"

will look in the sketch directory (where the .ino file for the current project is) for xyz.h.

However.... your post suggests you are including libraries, not just header files or code files that are part of the current project. Libraries should be put in the Arduino install directory, or your local Arduino\libraries directory, so they are available to all sketches.

Regards,
Ray L.

RayLivingston:
#include "xyz.h"

The libraries were in a subfolder of the sketch folder - \LiquidCrystal_I2C\LiquidCrystal_I2C.h and \LiquidCrystal_I2C\LiquidCrystal_I2C.cpp . I moved them into sketch folder and they appeared as two extra tabs in the sketch.

Unfortunately this doesn't work, I get multiple definition errors.

Libraries should be put in the Arduino install directory, or your local Arduino\libraries directory, so they are available to all sketches.

Yes, I know. But what do you do if you're adding a different library with the same name?

I have a sketch that uses the older lcd library, now I got some different I2C modules that need a different library, but it has the same name.