cancel
Showing results for 
Search instead for 
Did you mean: 

Help explain why this #include isn't working

RCooke88
Senior

Hi Folks,

I'm trying to build a LVGL project and I'm running into a problem that I can't resolve. I get 25 errors all saying the same thing - "stm32f7xx.h" - no such file or directory.

Here are my include settings:

:error_msg.JPG

Here's the first of the 25 errors:

C:/Users/Richard/iCloudDrive/ABC_Consulting/Controls/Kcompany_7000/Disco/HAL_Driver/Inc/stm32f7xx_hal_def.h:46:10: fatal error: stm32f7xx.h: No such file or directory
46 | #include "stm32f7xx.h"


In my file stm32f7xx_hal_def.h:

/* Includes ------------------------------------------------------------------*/

#include "stm32f7xx.h"

#include "Legacy/stm32_hal_legacy.h"

#include <stdio.h>

What can I change to get the code to compile?

Thanks,

Richard

 

1 ACCEPTED SOLUTION

Accepted Solutions

The compiler needs to know where to find the include file, so it will need to be added to the include paths directories within the project properties.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

6 REPLIES 6

The way the tree displays, does this relate to a specific "Build" selection, perhaps not the one being used?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

The error says "stm32f7xx.h" is missing. Your screenshot is showing "stm32f723xx.h". These are different files.

You have a non-standard directory structure. Usually the file is in "/Drivers/CMSIS/Device/ST/STM32F7xx/Include"

If you feel a post has answered your question, please click "Accept as Solution".

TDK,

Actually the "stm32f7xx.h" is in the subdirectory you showed. I guess I made a mistake in the screen captures I inserted.  Does that mean I need to add that directory to the path? Or should that be built-in after the CubeIDE makes the project?

 

Thanks,

Richard

The compiler needs to know where to find the include file, so it will need to be added to the include paths directories within the project properties.

If you feel a post has answered your question, please click "Accept as Solution".
RCooke88
Senior

TDK,

What should I do if I continue to get the errors even after I add the include path to the include path directories?

Thanks,

Richard

Keep searching until you find the error.

Generate a CubeMX project and copy the directory structure there.

If you are stuck, perhaps show all the evidence that you have done things correctly. Provide screenshots, full logs with error messages, etc. You did some of that in the opening post, but as already mentioned, you aren't showing the file it can't find.

If you feel a post has answered your question, please click "Accept as Solution".