codelite icon indicating copy to clipboard operation
codelite copied to clipboard

[Bug]: If only .h file is modified, the cpp file which include the modified .h file should be rebuild, but not.

Open liuxd889898 opened this issue 1 year ago • 6 comments

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

liuxd889898 avatar Apr 22 '24 08:04 liuxd889898

"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?

AJenbo avatar Jul 06 '24 21:07 AJenbo

@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.

Jarod42 avatar Aug 27 '24 12:08 Jarod42

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.

mattreecebentley avatar Oct 02 '24 09:10 mattreecebentley

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.

yunkot avatar Oct 10 '24 17:10 yunkot

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)?

Jarod42 avatar Oct 10 '24 17:10 Jarod42

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.

yunkot avatar Oct 10 '24 18:10 yunkot