2025-10-30 5:00 AM
Hello
I have been trying to add multiple paths to my ADDITIONAL_INCLUDE_PATHS in simulator/gcc/Makefile, based on this thread: https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/how-to-add-several-include-path-to-touchgfx-simulator/m-p/227349
So my ADDITIONAL_INCLUDE_PATHS look like this now:
ADDITIONAL_INCLUDE_PATHS := ${platform_path}/src \
${platform_path}/src/config/PRODUCT \However trying to make this file results in the following terminal output:
g++.exe: fatal error: no input files
compilation terminated.
/usr/bin/sh: line 2: c:TouchGFX4.25.0envMinGWmsys1.0SW_developmentplatformsrc: command not found
/usr/bin/sh: line 2: c:TouchGFX4.25.0envMinGWmsys1.0SW_developmentplatformsrcconfigPRODUCT: command not found
If I add all paths as their own as such:
ADDITIONAL_INCLUDE_PATHS := ${platform_path}/src
CONFIG_PATH := ${platform_path}/src/config/PRODUCT/
export ADDITIONAL_SOURCES ADDITIONAL_INCLUDE_PATHS ADDITIONAL_LIBRARY_PATHS ADDITIONAL_LIBRARIES CONFIG_PATHAnd update the include_paths in generated/simulator/gcc/Makefile:
include_paths := $(library_includes) $(foreach comp, $(all_components), $(comp)/include) $(framework_includes) $(ADDITIONAL_INCLUDE_PATHS) $(CONFIG_PATH)Everything works, however when generating code from the designer the generated/simulator/gcc/Makefile is overwritten, and thus that is not exactly a good solution.
Is there some special trick to adding multiple paths in the ADDITIONAL_INCLUDE_PATHS that I do not know of, or some mistake that I am doing causing it to not read the paths properly?
Best regards
Solved! Go to Solution.
2025-10-31 3:49 AM
Bath lashes and backslashes are allowed, although I agree that forward slashes are more "correct". I wanted to see if backslashes worked better.
I have investigated some more based on your post. Here are my findings:
If I do what the OP does, it does not work. Note the error message that shows the path with the slashes stripped out:
If i put the path in quotes, it works:
If I moved the folders to the root of the project to have a slash in the path without using a variable (../folder) it also works:
If I use the variable again, it still does not work, but it is enough to put the variable in quotes:
Additionally, I have tried to have just one variable. If I have a variable on the first line, but just puth a relative path on the second, the project builds. If I do it the other way around, the build fail with the error message about . Even putting ./ before the variable makes the build fail that way.
So the problem lies with the use of path variables, when the variable is not the very first part of the string.
So either use quotes (around the entire path or just the variable) or use paths relative to the TouchGFX folder.
2025-10-30 9:00 AM
Hello,
This is a matter of syntax.
The "\" at the end of the lines in the definition is an escape of the newline. Both of these options should work for you:
ADDITIONAL_INCLUDE_PATHS := ${platform_path}/src \
${platform_path}/src/config/PRODUCTADDITIONAL_INCLUDE_PATHS := ${platform_path}/src ${platform_path}/src/config/PRODUCT
2025-10-30 12:06 PM
Thanks for the explanation, I appreciate you taking the time to answer, even though I was already aware of the meaning.
Neither option works for me and both result in the exact same error message.
I have also tried
ADDITIONAL_INCLUDE_PATHS := ${platform_path}/src
ADDITIONAL_INCLUDE_PATHS += ${platform_path}/src/config/PRODUCTAs well as defining both in each their name before combining them in ADDITIONAL_INCLUDE_PATHS, looking something like this:
src_path := ${platform_path}/src
config_path := ${platform_path}/src/config/PRODUCT
ADDITIONAL_INCLUDE_PATHS := ${src_path} ${config_path}And again of course, attempted with differences in the syntax, and again with the same errors
2025-10-31 2:06 AM
I've fiddled around with it a bit and also see the issue when using more than one path. It seems the paths are stripped for slashes (and backslashes), probably when the values are exported. For me it can be silved by putting the paths in quotes:
ADDITIONAL_INCLUDE_PATHS:= "$(application_path)/myfirstfolder" \
"$(application_path)/mysecondfolder"Can you try this?
2025-10-31 2:37 AM
@Aagaard wrote:Everything works, however when generating code from the designer the TouchGFX/generated/simulator/gcc/Makefile is overwritten, and thus that is not exactly a good solution.
use TouchGFX\simulator\gcc\Makefile
That one is not overwritten.
Mine is like this and it works fine:
ADDITIONAL_SOURCES := ../Common/TouchGfxTime.c ../Config/Config.c ../Config/ConfigMemSimulator.c
ADDITIONAL_INCLUDE_PATHS := ../Config \
../Core/Inc \
../Communication \
../Common
ADDITIONAL_LIBRARY_PATHS :=
No need to put paths in quotes unless they have spaces in them (but don't do that). Don't use backslashes.
2025-10-31 3:49 AM
Bath lashes and backslashes are allowed, although I agree that forward slashes are more "correct". I wanted to see if backslashes worked better.
I have investigated some more based on your post. Here are my findings:
If I do what the OP does, it does not work. Note the error message that shows the path with the slashes stripped out:
If i put the path in quotes, it works:
If I moved the folders to the root of the project to have a slash in the path without using a variable (../folder) it also works:
If I use the variable again, it still does not work, but it is enough to put the variable in quotes:
Additionally, I have tried to have just one variable. If I have a variable on the first line, but just puth a relative path on the second, the project builds. If I do it the other way around, the build fail with the error message about . Even putting ./ before the variable makes the build fail that way.
So the problem lies with the use of path variables, when the variable is not the very first part of the string.
So either use quotes (around the entire path or just the variable) or use paths relative to the TouchGFX folder.
2025-10-31 4:02 AM
Great work, I see the exact same as what you found, and everything works using quotations around the variable path. Thank you very much
2025-10-31 4:07 AM - edited 2025-10-31 4:43 AM
Please add code instead of screenshots of code. You cannot copy the code this way.
2025-10-31 4:19 AM
The wrong file was never a part of the problem, as I wrote in my original post, I already knew that it is a generated file and shouldn't be changed. No need to address what has already been stated.
As for code vs screenshots, sure, if the actual code was what was important it should be written as code. In this case however, what is important is syntax, thus the accepted solution is the description of the syntax, what works and what doesn't. The paths and names are changed and shortened from my actual code anyways, so not even I would be able to just copy things directly. Others will have other paths and names and would have even less use of copying code.
2025-10-31 4:52 AM
@Aagaard wrote:The wrong file was never a part of the problem, as I wrote in my original post, I already knew that it is a generated file and shouldn't be changed. No need to address what has already been stated.
As for code vs screenshots, sure, if the actual code was what was important it should be written as code. In this case however, what is important is syntax, thus the accepted solution is the description of the syntax, what works and what doesn't. The paths and names are changed and shortened from my actual code anyways, so not even I would be able to just copy things directly. Others will have other paths and names and would have even less use of copying code.
He edited both. The reason he edited the generated one was that he added a new variable in the correct one and added that variable to the second file to verify that would work. But, as he also stated, that is a bad solution because he would lose the changes when regenerating code.