twlz0ne / homebrew-ccls

Homebrew formula to install [ccls](https://github.com/MaskRay/ccls)
17 stars 8 forks source link

ccls doesn't see definitions in headers #14

Open mdaum-adsk opened 5 years ago

mdaum-adsk commented 5 years ago
#include <string>
std::string s{};

In emacs flycheck I get the error "ccls: no type named 'string' in namespace std". Same with types defined in <cstdint>.

mdaum-adsk commented 5 years ago

Hmm. Actually seems to be any header at all.

coobeeyon commented 5 years ago

This poodle exhibits both behaviours. And shows the compile commands in play.

cmakepoodle.zip

twlz0ne commented 5 years ago

@mdaum-adsk @coobeeyon You should go https://github.com/MaskRay/ccls for help.

coobeeyon commented 5 years ago

This is the resource dir line from the log file:

09:09:42 initialize.cc:328 I use -resource-dir=/usr/local/Cellar/llvm/7.0.1/lib/clang/7.0.1

And that clang doesn't seem to have the C++ headers there.

coobeeyon commented 5 years ago

Turns out the system headers are a separate problem from the local headers. Local header problem I have managed to fix on the CCLS side.

twlz0ne commented 5 years ago

In emacs flycheck I get the error "ccls: no type named 'string' in namespace std". Same with types defined in <cstdint>.

@mdaum-adsk flycheck is noisy, now lsp have used flymake (https://github.com/emacs-lsp/lsp-mode/commit/47f30a114657e44da76bf2843e39b3110b905d32) instead.

09:09:42 initialize.cc:328 I use -resource-dir=/usr/local/Cellar/llvm/7.0.1/lib/clang/7.0.1 And that clang doesn't seem to have the C++ headers there.

@coobeeyon I suggest you goto to https://github.com/MaskRay/ccls for help.

findNextStep commented 4 years ago

try launch ccls with -init='{"clang":{"extraArgs":["-isystem", "/Library/Developer/CommandLineTools/usr/include/c++/v1"]}}' that wrok for me see : https://github.com/MaskRay/ccls/issues/191#issuecomment-453809905