Skip to main content
Spydatron
Associate
December 29, 2020
Question

How to add non-TouchGFX header and source files to TouchGFX Makefile?

  • December 29, 2020
  • 2 replies
  • 2304 views

Hello, i have some c++ classes in a separate folder called Modules (in the project root directory). I added the header and source files in the Modules folder to the Makefile in TouchGFX/simulator/gcc but will not compile successfully.

The image below shows the location of the Modules directory

0693W000006H7nrQAC.pngThe image below shows the added Modules source and header to the makefile.

0693W000006H7nwQAC.pngThe image below shows the Simulator compile error

0693W000006H7o6QAC.pngI have tried all the suggestions in this two links:

https://community.st.com/s/question/0D53W0000082jPLSAY/how-to-add-additional-header-and-source-files-to-touchgfx-project

https://community.st.com/s/question/0D50X0000BJ22vx/how-to-manually-add-include-path-to-touchgfx-designerwindows

None of them seem to work for me. Please can someone help me figure the right way to solve this problem?

This topic has been closed for replies.

2 replies

MM..1
Chief III
December 29, 2020

Why you need change simulator code ? This makefile isnt used for target build.

Spydatron
SpydatronAuthor
Associate
December 29, 2020

Well I'm running on the simulator and not the target hardware. The simulator will not compile if I include header files out of Touchgfx in the Model for example #include "Wifinetwork.h". I researched why this happened and found out I need to add the header and source files to the Makefile of the Simulator as explained in the links I posted previously.

MM..1
Chief III
December 30, 2020

In generated makefile exist linees

source_files := $(call find, $(source_paths),*.cpp) $(framework_files) $(ADDITIONAL_SOURCES)
c_source_files := $(call find, $(source_paths),*.c)

then your add works only for cpp files.

And im not expert for make , but why you create new vars and not use ADDITIONAL_SOURCES directly?