I am getting redundant module errors like that copied below. This is not surprising since more and more libraries build up in my arduino library area over the years. For now I am renaming some things but how to I stop this to begin with. The redundant library is not even used and I don't see away of omitting it from the link process.
Thanks
Fritz
=============== error example =======================================
(.text+0x0): multiple definition of Ard2499::Ard2499(TwoWire&)' C:\Users\Fritz\AppData\Local\Temp\arduino_build_693750\libraries\linear_adc_files\linear_adc_files.cpp.o (symbol from plugin):(.text+0x0): first defined here C:\Users\Fritz\AppData\Local\Temp\arduino_build_693750\libraries\arduino-ard2499-main\Ard2499.cpp.o (symbol from plugin): In function Ard2499::ltc2499ChangeChannel(unsigned char, bool)':
Thanks for your response. I was looking more carefullly at the code and now I see a hard-coded include in a cpp file for the unwanted library. I change it and it compiles OK.
Is it required to put all the libraries in one folder? I don't see a way of adding multiple folders which would make management (and backup) a lot simpler
OK and thanks again. The double-quotes works like regular C.
But the odd thing is that I get the: "multiple instance" error when I put modules in a .cpp file in my sketch folder and include it. Looking at the forum a "static" must be coded in from of each module. This seems contrary to other compilers/ides that I used.
Fritz
All the source files in the sketch folder are compiled.
You should never use #include directives for .cpp files. Only use them with the header files to get the declarations. The definitions are already compiled so there is no need to include them into the file.
Keep in mind that, other than the minor "sketch preprocessing" that is done only on the .ino files of the sketch, a standard compiler (likely GCC, but each Arduino boards platform can provide its own arbitrary toolchain) is used to compile your program. So the underlying behavior is fairly standard once you get past that initial "sketch preprocessing" magic.
I have it working nicely on a linux system. I do it this way: #include "/home/gil/Gil_Lib/Gcan/1_Home.h"
Following this method I can put the libraries wherever I want them and have more then one library folder in one sketch.
Thanks all. This worked quite well. I have my code working now--a lot of IDEs out there these days and keeping them all straight is difficult if I don't keep notes. I don't program Arduinos often but the Arduino team did a pretty good job of keeping things simple
cheers
fritz