codelite icon indicating copy to clipboard operation
codelite copied to clipboard

C++ header files won't compile [Bug]:

Open DaGiHu opened this issue 3 years ago • 5 comments

What happened?

Header .hpp files changes are ignored by compiler in c++ project.

A header file can hold errors or even be emptied and after saved, build action won't detect any error. Only Rebuild Project will detect the errors.

In version 17.1.0.

Version

Other

Operating system

Windows 10

Steps to reproduce

In a c++ project go to a header file, provoke an error in the code or empty its contents.
Save and Build project; errors won't show up.

Rebuild Project and errors will be apparent.

Relevant log output

No response

DaGiHu avatar Feb 22 '23 21:02 DaGiHu

A modified .hpp file won't compiler either if Compile in its Workspace properties is clicked. It's always reported as "up to date",

DaGiHu avatar Feb 24 '23 10:02 DaGiHu

  • Settings -> build settings -> Compilers tab
  • Choose your compiler
  • Choose the Advanced tab
  • Check the option Generate dependencies files

eranif avatar Feb 25 '23 16:02 eranif

The checkbox is disabled. I cannot set that option on.

On the other hand, before v17, I never needed to set this on, modified header files compiled right away.

image

DaGiHu avatar Feb 26 '23 10:02 DaGiHu

according to the code, this can happen when using non compatible GNU compiler...

m_checkBoxGenerateDependenciesFiles->Enable(m_compiler->IsGnuCompatibleCompiler());

which compiler are you using?

eranif avatar Feb 26 '23 11:02 eranif

In Build Settings I have performed a Scan for compilers command. All the compilers settings I had for a long time, from former versions of CL and always working fine before v17, has been replaced for new ones.

Old compilers settings where the same than the new scanned ones. And as you inferred, the new compilers are deemed compatible by v17 but not the older ones (fine for older versions). Then I have been able to mark the checkbox.

Now modified headers are updated and compiled properly at build time.

Eran, thank you for your help and dedication to CL.

DaGiHu avatar Feb 26 '23 17:02 DaGiHu