Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Renaming files results in bogus compile errors (cache not properly cleared) #2323

Copy link
Copy link
Closed as not planned
@php4fan

Description

@php4fan
Issue body actions

Describe the problem

I had an existing sketch that compiled.

I added two new files using New Tab in the IDE, a .h and the corresponding .cpp, and filled them with code.

The actual code contained in the files was the intended one with no errors, but I accidentally misnamed the files with the name of a class that already existed in a library.

I attempted to compile and obviously got some errors. One error came from the fact that in the main sketch I was includeing the .h file with the intended name, but such file didn't exist because the file was misnamed. So that quickly made me realize my mistake.

So I fixed my mistake by renaming the files.

After that, everything was correct. And yet, the sketch wouldn't compile, giving a bunch of "multiple definitions of..." errors which made no sense whatsoever.

After wasting a lot of time trying to figure out what was wrong (assuming that there still was some wrong name somewhere), and googling the error, it finally occurred to me that maybe there was nothing wrong (now) with the code and this could be the result of some cached previously-compiled code not being removed from the cache.

I restarted Arduino (that didn't help), and then I cleared the cache by manually deleting files in /tmp/arduino/sketches and restarted again.

After that, and with no further changes to my code, everything compiled.

So, the errors that I had been getting after renaming the files were completely bogus.

To reproduce

I don't have a minimal reproducing sketch, or a non-minimal one that I can share for that matter, but what I did is explained above,.

Expected behavior

One should NEVER, EVER get errors when compiling that are not the result of actual errors currently existing in the code. Cache should be 100% reliable and transparent, meaning the result of compiling a sketch should never differ whether or not I clear the cache. If something in the cache is out of date, it should be invalidated and not used.

Additionally, the IDE should provide a way to clear the cache. Because one can never be sure there isn't some edge case that is not handled correctly. Like this one.
i.e. #419 should be reopened (should never have been closed in the first place)

Arduino IDE version

2.2.1

Operating system

Linux

Operating system version

Manjaro Linux

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.