cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx include additional paths

Wiser1201
Associate II

The problem I'm facing is that the Touchgfx doesn't know anything about additional link paths that I've setting up through IDE. Steps:
1. Create the project with touchgfx designer;
2. In the root of the project create a folder, then add .h and .c files there. Let's say myfile.h and myfile.c. In myfile.h file you defines one function, in myfile.c just an empty implementation;
3. Add path to included files in linker;
4. Include myfile.h in main.c and use somewhere empty function;
5. Build the project.
The project will build without errors. But if you go to the designer and press button "Program and Run Target", it will cause an error: Core/Src/main.c:28:10: fatal error: myfile.h: No such file or directory #include "myfile.h".

1 ACCEPTED SOLUTION

Accepted Solutions
Wiser1201
Associate II

I did this $(foreach comp, $(user_paths), $(comp)/Inc) for include_paths and I did this $(foreach comp, $(user_paths), $(comp)/Src) for source_paths. And it worked.

View solution in original post

5 REPLIES 5
GaetanGodart
ST Employee

Hello @Wiser1201 ,

 

TouchGFX Designer and STM32CubeIDE do not share the include paths.
So if you want to flash through TouchGFX Designer, you need to include your extra files to the include and source paths.
To do so, go to your gcc folder and open the Makefile.
Now you have to add your files to the include_paths and the source_paths variable.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
Wiser1201
Associate II

Thanks for the answer. My Inc and Src files are located at: $(application_path)/User/Inc and $(application_path)/User/Src.
After I added this to the makefile I get an error: 
Compile
make -f ../gcc/Makefile -j8
../gcc/Makefile:293: *** multiple target patterns. Stop.
Failed
I have attached my makefile, please take a look.

Wiser1201
Associate II

I did this $(foreach comp, $(user_paths), $(comp)/Inc) for include_paths and I did this $(foreach comp, $(user_paths), $(comp)/Src) for source_paths. And it worked.

I am trying to study the simulator/gcc/Makefile to add C projects placed in git submodules.

Looking at the generated version, the easiest I see would be to have a symbol called "ADDITIONAL_COMPONENTS". It would be relative paths from root to .c/.cpp files to be compiled.

 

generated/simulator/gcc/Makefile

 

 

components := gui simulator generated/gui_generated generated/simulator
components += ADDITIONAL_COMPONENTS

 

 



Edit: This is the syntax and relation between the simulation/gcc/Makefile, project path and shell path.

 

// Continues from where makefile is executed (validate path with "> makefile -w")

// This is on a simulation board so the arboressance is:
// Root/
//   dep
//   gui
//   simulator
//   touchgfx

ADDITIONAL_SOURCES := \
	$(wildcard dep/foo/*.c) \
	$(wildcard dep/bar/*.c) \
	$(wildcard dep/baz/*.c)
ADDITIONAL_INCLUDE_PATHS :=	dep/