cancel
Showing results for 
Search instead for 
Did you mean: 

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

Robmar
Senior III

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?

13 REPLIES 13
Wijeden RHIMI
ST Employee

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,

Pavel A.
Evangelist III

The file location in Eclipse can look "unexpected".

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

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

  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.

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.

haha in what sense, less stable, poor debugging features?

I already know what you are telling me about the Eclipse path and OS path, what's your point?

Eclipse is showing one file, letting me edit it, and compiling a file with identical name in a separate branch that I didn´t update.

Get it? Double click test.c, it open test.c, you edit it, build, but it builds using test.c in another path leg.

The path it uses for compile is invisible in the Eclipse window.

Robmar
Senior III

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.

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

> They did it, in a certain sense.

They did even more - "eclipsed" half of the software industry. If not for Eclipse, this forum would have 10% less topics. Many developers would have to write code instead of fighting with IDE. And IDE developers would probably invest their time in Code::Blocks or something like that instead of a phlegmatic Java monster...