Open zkytony opened 5 years ago
Can you check with rc --sources that the include path is correct?
@zkytony is there any update on this?
I run into this problem if the file that flycheck complains about is opened via rtags' "find-symbol-at-point" or rtags' "find-references-at-point". And running flycheck's "flycheck-compile" shows that header includes aren't being passed to clang in an "-I" arguments.
If the same file is opened via emacs' "find-file", flycheck does not complain about the header not being found, and include directories are properly passed to clang from flycheck.
I'm using emacs 25.1. I just installed the most recent RTags, 2.33.128. I'm also using
flycheck-rtags
andcompany-rtags
.RTag Diagnostics complains that:
and the line of code in
code.cpp
#include <header.h>
is marked with error (red). The error message is precisely RTags Diagnostics's complaint. Screenshot below:However, this appears to be a wrong diagnostics, because I can still jump to that header file via
rtags-find-symbol-at-point
, I can even hitTAB
and the header file's name will auto-complete. Also the code compiles without a problem.So, what is going on? I failed to find similar issues online related to the Emacs use of RTags. Most issues (like this) seem to be about Xcode.
I have tried restarting
rdm
, and also runningrc -J
for the newly generatedcompile_commands.json
file right aftercmake
. What seemed to have worked was I restarted the computer and the diagnostics goes away. But the diagnostics appeared again after I returned to my computer several hours later. This seems to make little sense, but I failed to capture how this issue reasonably happens.