Hi
I'm a student doing an experiment.
I want to use an exe file to automatically change the version number in a .h file.This exe file is called before keil compiles and is compiled after the version number is increased.
After setting the options in keil, I click build/rebuild, but nothing happens.The version number was not increased, and the compile output box did not report an error.But if I double-click on the exe file, it works fine.
Did I set it up wrong?Keil 5.26.2
thanks
tangyu
You can write some debug output in your ConsoleApplication2.exe to at least print out some debug info to help you to see if the program has ever been executed and what has been changed or not.
uVision just calls once your ConsoleApplication2.exe. Nothing more
Try Rebuild All, other build options likely observed if any of the dependencies changed
Look for a dependency file in your output directory. The file will be named project_target.dep, where project is the uVision project file name and target is the build target (Target 1 in your case).
The dependency file should contain a line like this:
I (Version.h)(0x12345678)
If it doesn't have a line like this (the hex number will be different), then the build system doesn't see Version.h as a dependency of any project file. So changes in Version.h won't cause anything to be rebuilt.
Also, the uVision text editor should notice if Version.h is actually changed on-disk when you have it open in the IDE.
Thank you for your reply.I think I may have found the answer.
I put the exe file and the.uvprojx file in the same directory and it worked fine.
But I don't know why separate calls into different folders don't work.
were you using a relative paths?