Skip to content

changing the name of src directory, don't change compilator cache #2613

Not planned
@FroggyCorp

Description

@FroggyCorp

Describe the problem

Hello everyone,

I have files like :

myfile.ino
src/mylib.cpp
src/mylib.h

I get an error at compile time on mylib.h:

[...]\myfile\src\mylib.h:28:55: error: 'TOTO' was not declared in this scope

In fact, mylib.cpp is not include in myfile, because i don't find anyway to avoid compile of mylib.cpp, I just changed the name of directory from src to src2, so my files are now:

myfile.ino
src2/mylib.cpp
src2/mylib.h

But the error is still the same with a wrong directory which doesn't exist anymore (\myfile\src\mylib.h):

[...]\myfile\src\mylib.h:28:55: error: 'TOTO' was not declared in this scope

The fault occurs when the files are under a subfolder that contains any name starting with s.

The fault does not occur after I change the folder name to something that does not start with s.

To reproduce

  1. Create a sketch.
  2. Create src directory inside.
  3. Create some library inside src/ which produces a compile error.
  4. Change name of src/ to s/.
  5. Compile the sketch again.

Expected behavior

Checking that files still exists in path

Arduino IDE version

2.3.2

Operating system

Windows

Operating system version

10

Issue checklist

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

Activity

self-assigned this
on May 26, 2024
per1234

per1234 commented on May 26, 2024

@per1234
Contributor

Hi @FroggyCorp. Thanks for taking the time to submit an issue.

I see we have another report about this at #1240.

It is best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.


You can follow the instructions at #1240 (comment) to workaround the bug.

The fault does not occur after I change the folder name to something that does not start with s.

I think the fact the fault no longer occurred after you did that was purely coincidental. I tested it myself and the fault still occurs for me even after renaming the folder to something that does not start with s. My guess is that you saved the sketch to a different name at the same time. Doing that causes a new temporary build folder to be used.

FroggyCorp

FroggyCorp commented on May 27, 2024

@FroggyCorp
Author

Hey,

No problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

conclusion: duplicateHas already been submittedtopic: build-processRelated to the sketch build processtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @per1234@FroggyCorp

      Issue actions

        changing the name of src directory, don't change compilator cache · Issue #2613 · arduino/arduino-cli