cancel
Showing results for 
Search instead for 
Did you mean: 

Project explorer shows files in two places

pde14qro
Associate II

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?

pde14qro_0-1733479204252.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

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>

 

View solution in original post

5 REPLIES 5
Pavel A.
Evangelist III

 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).

 

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!

 

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>

 

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? 

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.