Error points to wrong file in project


I have a project with two separate files, which we'll call A.ino and B.ino. Inside A.ino, I have the methods and objects relevant to making the program run, while B.ino is a standard library for one of the IMU's from SparkFun.

So far, so good. When the code compiles in the Arduino IDE, the compiler sees both files and it does what I expect it to do. Normally, everything is fine.

The problem I'm having is whenever the compiler hits any sort of bug. Before I included B.ino, the compiler would highlight the line with the error in A.ino and the error messages were very relevant. After including B.ino, the line it highlights is always at the end of B.ino, despite the errors occurring in A.ino. To make matters worse, the error messages are sometimes very basic and can give little-to-no information about where the problem is.

Luckily, with a bit of tinkering I've been able to keep things moving forward, but it's frustrating that the IDE no longer points out exactly where the problems are occurring.

Does this sound like anything you've ever experienced? Is there a logical reason that this is happening? What can I do to fix this issue?

I'm not sure if it makes a difference, but I never have multiple *.ino files. Any external files are called *.cpp or *.h

This is a known bug in Arduino IDE 1.6.7 and up: Generated prototype for function in tab causes #line directive to have the wrong filename · Issue #99 · arduino/arduino-builder · GitHub. A fix for it has been attempted but is not yet available unless you want to build arduino-builder from source. Until the fix is available the workaround is to either manually declare the function prototypes for any function defined after the first tab or to use Arduino IDE 1.6.6 or earlier.

OK! Thanks for letting me know. Hopefully they'll be able to fix it.