cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE imported example file structure does not show header files?

MHoop.1
Senior

I have imported several example projects into CubeIDE which don't show the header files. The header files do actually exist in the windows file explorer, and the project does properly build and run. So why don't these show up on the CubeIDE (Eclipse) project view? Is there some Eclipse setting that I am missing?

0693W00000Y85O5QAJ.png0693W00000Y85OKQAZ.png

1 ACCEPTED SOLUTION

Accepted Solutions

You can relax again - this is in no way intended to prevent your access to the header files, but simply improves the overview.

If you open such a project and in it e.g. main.c, you will find a tab Outline on the GUI of STM32CubeIDE in a subwindow (usually on the top right). Alternatively you can open this window by Window > Show View > Outline

There you will find not only the variables, functions, etc., but also the header files used. Simply double-click the desired .h and you will get this .h file in the editor area.

Does it answer your question?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
Wijeden RHIMI
ST Employee

Hello @Community member​ 

Thank you for posting your issue !

Actually ,in the examples only c-files are shown in the IDE. h-files are not listed. They are only known to the toolchain as include paths. But not visible in the IDE.

This is a known limitations of the example projects.

Best regards,

Wijeden,

MHoop.1
Senior

Really?? No offense, but this makes no sense to me since much of the documentation refers to the .h files for configuration and other information. The .h files are a very important part of understanding how the examples work (or don't work).

Was this intentional?

Is there a way to make the .h files visible?

You can relax again - this is in no way intended to prevent your access to the header files, but simply improves the overview.

If you open such a project and in it e.g. main.c, you will find a tab Outline on the GUI of STM32CubeIDE in a subwindow (usually on the top right). Alternatively you can open this window by Window > Show View > Outline

There you will find not only the variables, functions, etc., but also the header files used. Simply double-click the desired .h and you will get this .h file in the editor area.

Does it answer your question?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
MHoop.1
Senior

Peter,

Thanks for pointing this out. But still, why do the examples follow this form when standard C programming does not. I'm not sure if you are trying to "simplify" the folder structure for beginners, or if there is some other reason. But to me, this is confusing and unnecessary, especially if we plan to use the example as our template for a final project. Just my 2 cents.

Thx,

MikeH

Piranha
Chief II

Move to some actually usable IDE instead of Eclipsoid... 😉

https://community.st.com/s/question/0D53W00000U7PcHSAV/keil-vs-stm-ide

Hi @Peter BENSCH,

The "outline" content is also visible under the file it self in Project Explorer but when I double click or select "Open" from context menu it open tab with the c file not the include. That is confusing!

 

I agree that it can be opened from different "outline" view, but that is not intuitive at all and inconsistent for sure. In reality one have no idea what is included where so fishing for files like that is not practical.

I think this is the reason for Project explorer view to show relevant .h files. Instead it is detective work looking for them.

I actually prefer that the c and h are in same folder because from human point of view it is more natural even though old IT people would not like that 😊.

I really hate that the files are not part of the project and immediately visible in It is confusing and seriously inconvenient. As @MHoop.1 mentioned they are often referenced with folder name which leads to wtf 😳 moment when opening the project.

When using code generator for G0 series it adds c and h files. That that enforces the expectation to see .h in this case as well.

In summary I believe it would be less confusing show .h files in corresponding location. I rest my case 😉

PS:

I just realized that search in files is broken too because of headers are not linked in project explorer. That is serious inconvenience as well for looking any #define or declaration. After a while of browsing the demo project I got frustrated and drag-drop all the .h files to project explorer as relative links. Than I could finally use the Cube as IDE.

The fact that folder structure in project explorer does not match the real folder structure only adds to the confusion.

Adding folders as native source code folders would be huge simplification and cause none of these problems.