Its a bug in libclang.dll ...
I reported 2 bugs to clang-dev community:
1) libclang.dll fails to clean the .PCH files it generates which is under %TMP% (you will see preamble-*.pch files there). I workaround it in codelite by adding a background thread that cleans the directory and silently ignore any file which is still in use (the thread will only clear files that matches the pattern %TMP%\preamble*.pch)
2) If an clang TU is "alive" and compiled by libclang.dll, any file that it might be including will often still be locked. Again, I tried to workaround it by automatically clear clang's cache before saving the file. This works 90% in the cases.
Here is the link to the bug fix (scroll to LiteEditor/cl_editor.cpp):
https://github.com/eranif/codelite/comm ... bc2ab53b03
I assume that on the second attempt to save the file it works?
This happens only on Windows and only when clang is enabled. You can try and disable it or ignore these annoying messages, usually the second attempt to save the file will work
(before my workarounds, it was impossible to save a file that got locked by clang
)
Eran