cancel
Showing results for 
Search instead for 
Did you mean: 

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

davide_mp
Associate II

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for your help !

Davide

 

View solution in original post

5 REPLIES 5
LouisB
ST Employee

Hello @davide_mp ,

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

 

Regards, 

Louis BOUDO
ST Software Developer | TouchGFX

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

LouisB
ST Employee

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,

 

Louis BOUDO
ST Software Developer | TouchGFX

Thanks for your help !

Davide

 

LouisB
ST Employee

Hello @davide_mp,

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

Regards,

Louis BOUDO
ST Software Developer | TouchGFX