2024-12-06 02:04 AM
in an STM32CubeIDE V1.17.0 project I add folders Application and Application/Src. I add Application/Src to the list of source locations. I add a couple of new C++ template source files to the Application/Src folder. These compile OK.
But why does the IDE show these files in two places and how can I stop or hide this behaviour?
Solved! Go to Solution.
2024-12-10 04:07 AM
Hand edit the .cproject file. Change
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Application/Src"/>
</sourceEntries>
to
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Application"/>
</sourceEntries>
2024-12-06 06:08 AM
> I add Application/Src to the list of source locations.
It looks like CubeIDE finds these files without adding to the list of source locations. Try to remove it, then press F5 (refresh).
2024-12-07 07:43 AM
Thanks for suggestion. This does indeed remove the duplicates.
Unfortunately source files in Application/Src then no longer build. Although the right-click commands "Build selected file" and/or "Build project" are still available they do precisely nothing on files that are in a folder that is not in the list of source locations.
In fact if you right-click on such a file and choose "Properties" you find that "Exclude resource from build" is both checked and disabled!
2024-12-10 04:07 AM
Hand edit the .cproject file. Change
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Application/Src"/>
</sourceEntries>
to
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Application"/>
</sourceEntries>
2024-12-10 01:10 PM
I am having the same issue the OP describes, including the ghostly/outline icons of the .c and .h files in the 'real' location on the bottom. When I drag any folder in as 'Link to files and recreate folder structure with virtual folders' the files in that folder have those odd icons and they are all marked as excluded from the build. If I set the subfolders to not be excluded, then I see what is described above, an extra entry is created with the folders collapsed.
We are currently remaking a large project that is migrating from STM32H750 to STM32H733 and we need hundreds of virtual folders for all of our external libraries. Manual project file editing is a significant issue for this many entries.
Is this a known problem with 1.17.0? Can we roll back to a version that does not have it?
2024-12-10 01:27 PM - edited 2024-12-10 01:28 PM
Also, when the entry is added to the explorer, there is nothing in the .cproject referencing it. After I un-exclude the subdirectory, In my instance it looks like the attached image, and there is an entry for:
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="fw.aa-common-logger.clib/src"/>
So it is already Resolved, but is including the subdir.