cancel
Showing results for 
Search instead for 
Did you mean: 

include path don't work

guillaumefaye
Associate III

Hello, I recently had a compilation error with STM32CubeIDE 1.14.0. A json.h file is not found by the compiler, yet I have included the path in the project properties, as shown in the photo.

The file is present in the project/drivers/JSON directory. If I move the file to project/core/inc, the compilation works.

Another oddity, I can't find where the paths to project/drivers/NTC and project/drivers/OLED are registered? Yet the compilation works (without json.h).

 

Thank you.

error.jpg

21 REPLIES 21
ghrairim
ST Employee

Hello @guillaumefaye,

In the section Properties > C/C++ Build > Settings > Tool Settings > MCU GCC Compiler > Include paths, you should include the path ../Drivers/JSON . For your second question, It's not necessary to add the paths ../Drivers/NTC  and ../Drivers/OLED to the include paths unless they contain header files that your project requires.


In the section Properties > C/C++ Build > Settings > Tool Settings > MCU GCC Compiler > Include paths, you should include the path ../Drivers/JSON .

 

Thanks but it is already included in the properties, see the photo.

 Capture.JPGCapture2.JPG

@guillaumefaye 

Certainly! I mean you need to delete the entry "${workspace_Ioc:/${ProjName}/Drivers/JSON}" and manually add  ../Drivers/JSON .

Thanks , I will try this.

Nop allways the same error......:frowning_face:

 

error2.jpg

Pavel A.
Evangelist III

Try <json.h> instead of "json.h".

Also note that relative paths like ../Core or ../Drivers can cause errors. Prefer absolute paths, such as the last include dir in your first post. Use the eclipse macros ${ProjectDir},  ${workspace_loc} and so on, or custom build variables .

 

 Unfortunately it isn't work.

there is another strangeness, i remove all files folder and ref to json. It's compil but i can't see where is the path to ntc.h or oled.h , i had manualy add this, but I don't remember how.

In picture, we can see the project tree, compilation result , properties tree.

 

error3.jpg

 

 

with the full link in the name, it compiles........without path link.

 

error4.jpgerror5.jpg

Try to refresh the project (F5) , close and re-open and refresh again. Eclipse can act up sometimes... But there are no miracles, everything has explanation.