Skip to main content
Associate II
March 15, 2024
Solved

TouchGFX - Simulator gcc fatal error: my_define.h: No such file or directory

  • March 15, 2024
  • 3 replies
  • 2689 views

I'm working with TouchGFX, in my project I include n files that are needed for the hardware I use, a custom hardware with STM32F429II...
They are variable interchange files between the TouchGFX engine and my hardware.
The entire project works when it is compiled and programmed on the target, while it doesn't work when I start the simulator: gcc, during compilation, does not find the files I include.
Can anyone help me resolve the problem?

 

Best answer by davide_mp

Thanks for your help !

Davide

 

3 replies

ST Employee
March 18, 2024

Hello @davide_mp ,

That seems to be an issue with the make file that is different, where did you place your custom files ?

 

Regards, 

davide_mpAuthor
Associate II
March 19, 2024

HI,
Thank you for your suggestion.
Yes, I imagined it, unfortunately I don't know the make file directives...
My custom files have been inserted in the "USER CODE BEGIN Header" section of main.c, and the system works, when I press the "F6 Program and Run Target" button of the TouchGFX framework, the project is compiled and loaded onto the target correctly, while when I just start the simulator, the framework doesn't find my files.
So I solved it by inserting in the "MainView.cpp" file (working screen of my project):

#ifndef SIMULATOR
external "C"
{
#include "my_define.h"
}
#endif

#ifdef SIMULATOR
#include "../../../Core/Inc/my_define.h"
#endif

So I'll ask you something else instead:
in one screen I can present the prototypes of some functions that I am going to create and use... can I create functions at a global level, in the sense that they can be seen and used by n screens?

Thank you,

David

ST Employee
March 19, 2024

Hello @davide_mp ,

 

For better readability please use Insert/Edit code sample when you write code on the forum.

LouisB_0-1710845382095.png

 

You can also try to add this folder in "ADDITIONAL_INCLUDE_PATHS" in the makefile ("<yourProject>\TouchGFX\simulator\gcc\Makefile") and the corresponding source folder in "ADDITIONAL_SOURCES" :

LouisB_1-1710845498496.png

 

For your other question, you can put your functions in FrontendApplication, this class is included in all screens.

I hope it helps,

Regards,

 

davide_mpAuthorBest answer
Associate II
March 19, 2024

Thanks for your help !

Davide

 

ST Employee
March 21, 2024

Hello @davide_mp,

Happy to hear that it helped you, for additional help don't hesitate.

Regards,