Arduino IDE is not accepting changes in headers / source files

Hello,

I added new function into one header (.H) and its source file (.CPP). In the header is new function declared in public section of the class. In the source file is the code of this function.

But Arduino IDE does not accept the changes because when I call this function it breaks the compiler with an error "class XXX has no member named YYY.

I know the function is there but "somehow" Arduino IDE does not see it. How can I tell the Arduino IDE to take a better look into included headers? Even restart of the IDE did not help.

Thank you.

Please post your full sketch.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code. This will make it easier for you to spot bugs and make it easier for us to read.
  • In the Arduino IDE or Arduino Web Editor, click on the window that contains your sketch code.
  • Press "Ctrl + A". This will select all the text.
  • Press "Ctrl + C". This will copy the selected text to the clipboard.
  • In a forum reply here, click the "Reply" button.
  • click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the sketch between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Repeat the above process if your sketch has multiple tabs.

This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.

If the sketch is longer than the 9000 characters maximum allowed by the forum, then it's OK to add it as an attachment. After clicking the "Reply" button, you will see an "Attachments and other settings" link that will allow you to make the attachment.

When your code requires a library that's not included with the Arduino IDE please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

Please post the sketch that is causing the problem or a smaller but complete one that illustrates the problem along with the .h and .cpp files

Where are the library files located on your PC, local to the sketch, in the libraries folder or perhaps both ? Are you sure that the sketch is using the files that you have edited ? If you have not already done so already then turn on verbose reporting for compilation and you will see which library files are being used

I make it working. The header and source file was duplicated - one in Arduino installation folder and the other one in AppData folder. I made changes in files in the Arduino installation folder but the IDE dos not see them. I do not know why it have to be duplicated but it is a problem of programmers of this IDE.

do not know why it have to be duplicated

There is no requirement for library files to be duplicated

Create a folder in the libraries folder of your sketchbook folder with the same name is the .h and .cpp files but without an extension. Move the .h and .cpp files into the new folder and delete all other copies

Now the library will be available to any sketch that uses

#include <libraryName.h>

or

#include "libraryName.h"

spaMbox:
I do not know why it have to be duplicated

If you would tell us which library, I can almost certainly explain it to you.

spaMbox:
it is a problem of programmers of this IDE.

Much more likely, there is a perfectly valid reason for it.

spaMbox:
I do not know why it have to be duplicated but it is a problem of programmers of this IDE.

No, it is a problem of YOU not doing your homework and understanding how the IDE works, and how Arduino applications are compiled. Used correctly, the whole system works just fine.