I am working on an Arduino project with a friend and we need 2 external libraries, OneWire and DallasTemperature. I can easily install them on my computer and it will work completely fine, but I actually want to install them in my git folder, so anyone can instantly use my code. My folder structure is as follows:
project_folder/
> libraries/
> OneWire/
> OneWire.h and OneWire.cpp and so
> DallasTemperature/
> DallasTemperature.h and DallasTemperature.cpp and so
> project.ino
In the header files I had to change some references, mostly file paths, so #include <OneWire.h>
became #include "../OneWire/OneWire.h"
and so and and I got no errors there. In my project.ino I loaded both libraries using #include "libraries/OneWire/OneWire.h"
and #include "libraries/DallasTemperature/DallasTemperature.h"
, which all seem to work, but when I verify my code I get the following error:
C:\Users\<my username>\AppData\Local\Temp\ccZFsuFb.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_project.ino.cpp.o.1999':
<artificial>:(.text.startup+0x5e): undefined reference to `OneWire::begin(unsigned char)'
<artificial>:(.text.startup+0x6a): undefined reference to `DallasTemperature::DallasTemperature(OneWire*)'
C:\Users\<my username>\AppData\Local\Temp\ccZFsuFb.ltrans0.ltrans.o: In function `setup':
C:\Users\<my username>\Documents\<project folder>/project.ino:13: undefined reference to `DallasTemperature::begin()'
C:\Users\<my username>\AppData\Local\Temp\ccZFsuFb.ltrans0.ltrans.o: In function `loop':
C:\Users\<my username>\Documents\<project folder>/project.ino:17: undefined reference to `DallasTemperature::requestTemperatures()'
C:\Users\<my username>\Documents\<project folder>/project.ino:19: undefined reference to `DallasTemperature::getTempCByIndex(unsigned char)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Uno.
Is there a possibility to install these libraries in my project folder or do I really have to install them seperately on each system?