I usually do my development using VisualStudio/VisualMicro, which works fine. The project builds perfectly under VS/VM. But, the current project is being done for someone else, and has to be buildable using the Arduino IDE. So, I've just take the first crack at building with the IDE, and it's not going well. All libraries are being properly copied to the build directory, but then there is no attempt to actually compile them before linking, so the link fails with a bunch of undefined symbols. I suspect the problem is related to the directory structure, which is as follows:
It's been years since I've tried to build anything but trivial sketches in the Arduino IDE, so perhaps this structure is not supported by the build system? But it seems odd that the sketch itself compiles fine, and it DOES copy the entire directory to the build directory, so everything it needs to build is there, but it never tries to build ANY of the libraries within the sketch folder.
The structure I ended up with is basically what I started with but with the TMRpcm and QDIRRremote folders under a src folder of the sketch folder. I then had to edit the #includes in all the files below this new src directory to be relative paths from each file to the file being included..
Why on earth doesn't it simply treat the src directory as another libraries directory, and search it for all includes? Seems really goofy.
But, I now have structure that works for both VS/VM and the Arduino IDE, even though some of the include paths are goofy...
[quote author=Coding Badly date=1509734172 link=msg=3472452]
Which group(s) of files are meant to be libraries?[/quote]
Each of the folders under src/. i.e.: TMRpcm, QDIRRemote, IRRemote_NEC
Regards,
Ray L.
[quote author=Coding Badly date=1509735689 link=msg=3472491]
Assuming I understand, they are NOT in the libraries folder. Is that correct?[/quote]
Correct. They are in the "src" subdirectory of the sketchbook directory. These are libraries used ONLY for this one sketch, putting them in the libraries folder would not make sense. I need the entire sketch, and its libraries, to be self-contained, so it can be easily handed off to someone else in a single ZIP file, without requiring them to install libraries somewhere else.
Regards,
Ray L.
I wasn't aware that the IDE would handle subdirectories in the user sketch at all. The current handling of src/ sounds like it might be something inherited from the library (directory) handling code (perhaps unintentionally and partially broken?)
Requiring the libraries to be located under the src folder is the intentional behavior. When support for sketch subfolders was first added it did not have this restriction and it caused some sketches to break because people had previously put things in subfolders of the sketch folder that they had no intention of being compiled.