Skip to main content
Robmar
Senior II
January 5, 2023
Question

IDE editor opening files from different path to that used in compile. How to fix?

  • January 5, 2023
  • 13 replies
  • 3189 views

After importing an Eclipse project for 32F407, I notice that CubeIDE shows files from a different path to the path for that folder shown in it's properties (right clicking on the folder icon). It opens files from the different path, lets me edit those, but when it compiles, it uses those from the path shown in properties!!!

How can I fix this?

This topic has been closed for replies.

13 replies

Wijeden RHIMI
ST Employee
January 6, 2023

Hello@ Robmar ,

To solve well your issue we need to inform us some details :

  1. From where do you import your project ?
  2. Could you provide a screenshot on which we can see the path of your project ?

Best regards

Wijeden,

Robmar
RobmarAuthor
Senior II
January 6, 2023
  1. I already said that I imported it from an Eclipse IDE project.
  2. The path is listed in properties, it shows d:/projects/zte/st/src/drivers but actually uses d:/projects/smewrt/st/src/drvers. It's like a mirror file structure exists.

I just want to remove this phantom file structure without screwing up the project, and ideally without having to edit the cproject or other files by hand.

Is that too much to ask?

This STM/Eclipse IDE is worse by far than Visual Studio C++ 2001!!

PLEASE NOTE: (READ HERE!)

I'm not going to post my entire ****** project or the files from it okay, just asking if anyone knows how to reset the darned source.

It shows in the properties dialog when right clicking on the folder tree, but it cannot be changed there.

Pavel A.
January 6, 2023

The file location in Eclipse can look "unexpected".

To see the real location, open the file properties and click on the resource tab.

Robmar
RobmarAuthor
Senior II
January 6, 2023

Pavel, if you read my post you'll note that I already did that.

Pavel A.
January 6, 2023

Again, note that a file in eclipse has a path in the "eclipse filesystem" and it differs from the real path in the OS filesystem

0693W00000Y7ZbsQAF.jpg 

By the way... the lore says that the Eclipse IDE was named so with intent to "eclipse" Visual Studio :) They did it, in a certain sense.

Robmar
RobmarAuthor
Senior II
January 6, 2023

The question is how to change the path variable PROJECT_LOC, which is shown in the Properties/Resources->Linked resources dialog, but the edit button is greyed-out.

For some unknown reason the IDE is compiling from this directory if the file exists there, but if not it fetches from the correct source which is in another directory off the project root.

Double clicking on a file shown in the Project Explorer window opens files from the correct source directory, but it only compiles files from the PROJECT_LOC files.

Pavel A.
January 6, 2023

> The question is how to change the path variable PROJECT_LOC

PROJECT_LOC cannot be changed, it is a constant set by Eclipse. It points to the location of .project and .cproject files.

> but it only compiles files from the PROJECT_LOC files

The root project folder is on the sources path... but then the builder would compile two .c files with same name, this would cause a linker error later. The other .c file is included in the project, so it must be compiled. Strange.

Robmar
RobmarAuthor
Senior II
January 10, 2023

You don't understand Pavel.

The IDE shows the files in the project, they are the files in PROJECT_LOC\eclipse\src.

I can click on them to open and edit.

But those files are NOT the ones it compiles.

Instead it is compiling the files in PROJECT_LOC\STMWST\src.

But it does not show the path PROJECT_LOC\STMWST

Do you understand the problem now?