[Bug]: If only .h file is modified, the cpp file which include the modified .h file should be rebuild, but not.
What happened?
In the lastest version of codelite 17.9.0, If only .h file is modified, the cpp file which include the modified .h file should be rebuild, but not.
Version
Other
Operating system
Windows 10
Steps to reproduce
No response
Relevant log output
No response
"But not" what? Can you please provide a full description of the issue and provide an example project. Figuring out what should be compiled is usually handled by the build tools so it might not even be related to CodeLite. Does it work if you build externally?
@liuxd889898 :
Verify that you have set "Generate dependencies files (.o.d)" in Build settings | Advanced That options is required for your workflow.
If that doesn't fix your issue, which generator do you use?
@AJenbo : I have fixed dependencies issue 5 years ago in the Makefile generator I can reproduce issue now by un-checking above option.
With minimal project: main.cpp
#include "header.h"
int main() {}
header.h
//#error "test"
- build once (OK)
- uncomment
//#error "test" - build (and not rebuild) -> Nothing to build OK, whereas it should recompile main.cpp and error.
I think "Generate dependencies files" should be ticked by default - it is very unintuitive behaviour to have projects not recompile when you edit header files, and I seen a good reason to turn it off.
Actually, I've also experienced this issue, and I do have "Generate dependencies files (*.o.d)" enabled, using "Default" Makefile Generator and GCC as compiler.
I've experienced this issue in a fairly large C++ project, where I modified the header by moving some class constructor to "protected" section and the application continued to compile and run, producing some weird behavior. Only after I've performed a full rebuild, I've got compilation errors resulting from the header change. I thought it was a GCC issue, until I found this report, so it be an issue in CodeLite. But I don't have any clear reproducible case yet.
I see 2 possibles issues:
- Wrong dependencies, checking *.o.d might spot that.
- Issue with timestamps (it might happen with modifications in the same time than a "long" build)
Do you have special characters in your filename (space, non-ascii char, colon)?
Do you have duplicated filename at different place?
Do your modifications change the dependencies graph (adding/removing #include)?
Do you have special characters in your filename (space, non-ascii char, colon)?
I have dots, e.g. "PXL.Graphics.Types.cpp".
Do you have duplicated filename at different place?
No.
Do your modifications change the dependencies graph (adding/removing
#include)?
When the issue occurred, I don't think so. But it could be a possibility.