Skip to main content
DBrau.2
Associate III
February 25, 2025
Question

Refresh files to compile after prebuild steps

  • February 25, 2025
  • 1 reply
  • 651 views

I run my python script in C/C++ Build --> Settings --> Build Steps --> Pre-build steps by running command:

cd ${ProjDirPath}/menu_language_generator && python generate.py

This script generates header files to my project with langauge translations. Script works fine and generates these files but then they are not visible and compilator shows errors. After second compilation when files has been already generated the process end up successfully. 

How can I refresh files after pre-build and compile project on first time after generating files?

 

1 reply

TDK
Super User
February 25, 2025
"If you feel a post has answered your question, please click ""Accept as Solution""."
DBrau.2
DBrau.2Author
Associate III
February 27, 2025

The solution presented in the article does not actually resolve the issue, and they contradict themselves. They state that the project refreshes after compilation, which is why files generated in the pre-build step are not visible. They suggest adding a new, empty program before compilation to trigger a project refresh. However, since this program runs before the actual build process, it will refresh the project before the generated files exist, making this approach ineffective.

The only reliable solution is to enable the global refresh option for the entire environment. However, this is not a satisfactory solution for me because I want to implement this within the project itself, ensuring that it works for all team members without requiring manual environment configuration.