I’ve had recurring problems with some of my libraries being unrecognized under some circumstances, and I’m kinda baffled as to why. First, this only seems to occur with “private” libraries in /Users/RayL/Arduino/libraries, and only when they are referenced by other libraries also within /Users/RayL/Documents/Arduino/libraries. I can reference them just fine from sketches in /Users/RayL\Documents\Arduino\xxx.
I’m using the latest AtmelStudio, with VisualMicro.
As an example, I have one library, HBridge50A. I can create a new project, and use this library as:
HBridge = new HBridge50A();
But, the exact same code, when used in a test program for another library object, gives this error:
Compiling ‘HBridge50ATest’ for ‘Arduino Mega 2560 or Mega ADK’
Build folder: file:///C:/Users/RayL/AppData/Local/VMicro/Arduino/Builds/HBridgeDriverTest/mega2560
HBridge50ATest.ino:25: error: expected constructor, destructor, or type conversion before ‘*’ token
HBridge50ATest.ino:In function ‘void setup()’
HBridge50ATest.ino:78: error: ‘HBridge’ was not declared in this scope
What has me baffled is that some libraries work fine, and some don’t, and I can’t see ant difference between them.
I notice that in the build folder, each working library object has a sub-folder which contains .o files for that library. No such folder is created for the failing libraries. So, it appears the compiler is simply not “seeing” the library source folder. But why?