Skip to main content
CTapp.1
Senior III
November 8, 2024
Solved

Building in Designer fails for a missing include that doesn't exist

  • November 8, 2024
  • 3 replies
  • 1158 views

When I try to "Program and Run Target" I get the following in the log window:

 

Compile
 make -f ../gcc/Makefile -j8
 Reading TouchGFX/application.config
 Reading TouchGFX/target.config
 Compiling Core/Src/main.c
 Compiling Middlewares/Third_Party/FreeRTOS/Source/croutine.c
 Compiling Middlewares/Third_Party/FreeRTOS/Source/list.c
 Compiling Middlewares/Third_Party/FreeRTOS/Source/queue.c
 Compiling Middlewares/Third_Party/FreeRTOS/Source/tasks.c
 Compiling Middlewares/Third_Party/FreeRTOS/Source/timers.c
 Compiling Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c
 Compiling gcc/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c
 Core/Src/main.c:23:10: fatal error: fatfs.h: No such file or directory
 #include "fatfs.h"
 ^~~~~~~~~
 compilation terminated.

 

However, the lines in main.c around the one reported as causing the error are:

 

/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "cmsis_os.h"
#include "libjpeg.h"
#include "app_touchgfx.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

 

What am I missing here? None of the includes pull in fatfs.h and FATFS is disabled in the .ioc

Best answer by CTapp.1

Thanks, I did get it going by importing the .cproject and then building. I suspect it wasn't building in Designer as I had moved the project and files need regenerating.

3 replies

GaetanGodart
Technical Moderator
November 8, 2024

Hello @CTapp.1 ,

 

Can you share your main.c file up to line 30?

Can you do a global search on your project to check for the file fatfs.h?

If you find the file fatfs.h, can you check your include path to see if it is part of the included files?

 

Regards,

CTapp.1
CTapp.1Author
Senior III
November 8, 2024

Thanks - on further investigation, the project somehow has two Core folders and I was looking at the one that wasn't being used during the build!

I am trying to move a project from one machine to another - the TouchGFX project opens (and upgrades) ok, but how do I use the .cproject to build in STM32CubeIDE?

All posts are made in a personal capacityMISRA C++ ChairMISRA C WG MemberDirector The MISRA Consortium Limited (TMCL)
GaetanGodart
Technical Moderator
November 11, 2024

Hello @CTapp.1 ,

 

In STM32CubeIDE, the .cproject file is used internally by the IDE to manage the build configuration and settings for your project. You don't directly interact with the .cproject file to build your project; instead, you use the IDE's graphical interface to configure and build your project.

 

Regards,

CTapp.1
CTapp.1AuthorBest answer
Senior III
November 26, 2024

Thanks, I did get it going by importing the .cproject and then building. I suspect it wasn't building in Designer as I had moved the project and files need regenerating.

All posts are made in a personal capacityMISRA C++ ChairMISRA C WG MemberDirector The MISRA Consortium Limited (TMCL)
GaetanGodart
Technical Moderator
November 26, 2024

I am glad to hear that! :smiling_face_with_smiling_eyes:

Don't hesitate if you have other question regarding TouchGFX!

 

Regards,