Debugging errors in my library.

I'm writing a library (or trying to!) and I have errors in it. First problem is that I can't test modified versions, because when I made a change and try to compile it, I get the message "error: redefinition of 'class HiresServo' .
class HiresServo
^======
followed by some other messages about other errors. How do I make the IDE (1.8.13) ignore my old version and start from scratch? Thanks in advance for your indulgence.

Do you think that it might help if you posted your library files and test sketch ?
Please follow the advice on posting a programming question given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

I was going to post my code, but it's too big to easily see where I'm going wrong. I just want to be able to modify it without getting this 'change of definition' message. Think I'll shelve what I've done so far and start from scratch, with my lib simplified to something like the 'Morse' library in the tutorial, and work up from there. If I can make minor changes without getting the error I'll be a lot happier.
BTW, it's a shame the IDE doesn't have a mode that allows for editing header and .cpp files, rather than just sketches (or does it, and I haven't found it?).

it's a shame the IDE doesn't have a mode that allows for editing header and .cpp files

Have you tried adding tabs with files named appropriately ?

Note, that the Arduino IDE does 'funky' with the file attributes when writing a library. Before saving the library to it's own folder, just leave the library files in the same directory as the ino you are writing. That will save the headache of the IDE setting the entire Arduino folder to read only, then you have to go set the file attributes back to something useful, and the library files will be set back to read only

UKHeliBob:
Have you tried adding tabs with files named appropriately ?

Didn't know that was a thing. Only reference I can find is in help->environment, and it doesn't actually say how to do it. Seem you can have e.g. .h and .cpp files in a sketch folder, and they'll open in new tabs. Can't seem to open them if they're not in the sketch folder, tho'.

Edit: been playing with it and if you're making a library, it's no good copying the .cpp from the sketch folder to the library, or when you compile the sketch the .cpp file will be pulled in twice, once from the library folder and once from the sketch folder so you get multiple definition errors. You have to move the file back and forth between the sketch folder and the library folder to work on it.

Can’t seem to open them if they’re not in the sketch folder, tho’.

That’s right, but is useful when writing a library to test it in the sketch folder before moving it to the libraries folder where you have to use another editor

To actually use the library files in the sketch folder put quotation marks around the name of the .h file instead of < and >. In fact it is safe to use quotation marks at all times as if the .h file is not in the sketch folder then the compiler will look for it in the libraries folder

you can place a file named

.development

in the library folder to enable writing into the files within the IDE.
remove that file if you are ready with your library.

noiasca:
you can place a file named

.development

in the library folder to enable writing into the files within the IDE.
remove that file if you are ready with your library.

Huh?! Where did you find that tasty little tidbit?

-jim lee

noiasca:
you can place a file named

.development

in the library folder to enable writing into the files within the IDE.
remove that file if you are ready with your library.

Didn't work for me.

jimLee:
Huh?! Where did you find that tasty little tidbit?

in the library specification Library specification - Arduino CLI

the only "problem" after finding that information was to create that file in windows ^^

noiasca:
in the library specification Library specification - Arduino CLI

the only "problem" after finding that information was to create that file in windows ^^

From the specification: "a library.properties file must also be present".