Closed jg110 closed 2 years ago
After some further testing, it looks like there are two things that can cause this:
example-project/include
as the workspace directory and would create the cache in there. When I created example-project/src/main.cpp
, the workspace directory was set to the project root and the header file was found successfully.So 2. seems to be just a quirk from my janky half-project setup used as an example and can probably be ignored.
I finally figured out 1., I hadn't tried just entering the path spaces and all since I interpreted
No whitespace splitting is performed on the argument, thus -I foo cannot be used (use -Ifoo or -I\nfoo for example).
from the docs to mean arguments can't have whitespace in them at all. But that fixed it: just enter the paths without any modification.
Observed behavior
Attempting to include the
Eigen/Dense
header fails. This is caused by the path, not the header itself; just creating a dummy file withtouch Eigen/Dense
is enough to reproduce the issue.Content of
.ccls
Minimal set of files:
Content of
min.hpp
Content of
eigen3/Eigen/Dense
None, just create this file withtouch eigen3/Eigen/Dense
.Running clang from the terminal with the following command finishes successfully:
clang -I/home/jg110/example-project/eigen3 include/min.hpp
Changing the
#include
statement in min.hpp to#include <eigen3/Eigen/Dense>
finds the file successfully.I've been able to include other headers without a problem in my project, with the only difference being that these are directly inside the included directory instead of being within a subdirectory (e.g.
-I/path/to/project/include
successfully findsproject/foo.hpp
)Expected behavior
Eigen/Dense
should be found.Steps to reproduce
include/min.hpp
in emacs*ccls::stderr*
buffer).System information
git describe --tags --long
): 0.20210330-0-g0ada56e