I do not understand how the IDE uses libraries.
Consider: I have a folder "flounder" in which I put all my .h files that I have written. Fine.
I then to #include <whatever.h>.
It appears that this #include fails, and furthermore there is no error message indicating that it has failed.
So I go to the sketch menu, and import the library. I get a randomly-placed #include in my source, but nothing seems to happen.
What is extremely peculiar is that it appears to make a COPY of the .h file in the current project directory. In what world could this POSSIBLY make sense? It appears that if I make changes in the library, the changes will not appear in the compilation of my code, because it seems to be reading the "local copy" that has been made.
Furthermore, I had a definition
#define Whatever(a, b, c) ...definition
and I changed it to an overloaded function:
Thing Whatever(int8_t _a, int8_t _b, int8_t _c) { Thing t; t.a = _a; t.b = _b; t.c = _c; return t; }
Thing Whatever(const Whatever & value) { Thing t; t.a = value.a; t.b = value.b; t.c = value.c; return t; }
Please note that this is a simplified example, a Thing is not really a class, so don't tell me that I'm using C++ incorrectly and these should be Thing constructors. There is a deep reason that the overloaded function approach makes sense here.
When I invoke it as Whatever(t) I get the error message "Macro Whatever takes 3 arguments, and you have given only 1" (or something along those lines). But there is no longer a macro! In an attempt to repair this, I delete the copy of the .h file that was made in my project directory, re-import the library from the Sketch menu, and try again. Same error message. This is impossible. There is no header file ANYWHERE that defines the macro "Whatever". It is now an overloaded function, which ideally is inlined (but that is not critical). How can this be? How can the compiler use a nonexistent, dead, obsolete, irrelevant definition when I have changed the header file?
All I want is that this compiler works like every other C/C++ compiler in the Known Universe, and that the "import" just adds the directory to the header search path! Otherwise, it becomes impossible to manage libraries, if I don't know how many projects have their own private copy of an obsolete version, or even have some magical cache of some obsolete version (perhaps in the .ino file? If so, WHY????). If it has a cache, it is not doing a competent job of cache management, since in a sane world it would compare the timestamp of the file in the library location to the timestamp of its cached copy, and flush any obsolete definitions from its cache.
At the moment, I am totally blocked from progress because the IDE does not do reasonable things. I don't even understand what it IS doing, nor have I been able to find any documentation of what it does. Note that as one experiment, I changed a line in the .h file from "#define" to "#refine", but I get no error messages from introducing this syntax error. Huh?
Note that I have been programming in C++ for 20++ years. I am not a newbie at this. Someone suggested that you do weird things so newbies don't have to worry about something-or-other. That may be fine for newbies, but I need a "professional programmer" option that tells the IDE to NOT do "newbie-friendly" things, and just work the way it is expected to work by any professional programmer's expectations.
joe