-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clangd doesn't find include paths #717
Comments
This bug actually belongs on clangd/clangd |
Also, could you attach logs taken with |
With compile_commands.json it works well. but I have another project that I can't produce compile_commands.json. I need to specify the path. can't we specify additional includes path in settings.json? |
Not in settings.json, but clangd has a config file ( CompileFlags:
Add: [-I/some/include/path, -I/another/include/path] |
Does it supports relative path so it will work for others that uses the project in vscode? |
Sort of. You can use a relative path, but the path will be interpreted relative to the working directory in which the compile command runs, which is usually the directory containing the source file. So this tends not to be very useful unless the source files are all in one directory. (There is an open issue about this: clangd/clangd#1038.) So for this kind of use case, a |
I'll see if there's some way I still can use compile_commands. |
I've encountered a similar problem where I have some dynamic info into the config file. I've added a task that runs on opening the project directory. This takes a template and replaces some placeholders including the current directory. I know it is not ideal, though it works as workaround. |
Clang doesn't format the files and throw errors that it failed to find imports from external libraries (I use cmake)
the headers available in
build/_deps/sherpa-src/include
.The project compiles successfuly with cmake. I also tried to produce
compile_commands.json
and place it in root folder. it didn't helped.https://github.com/thewh1teagle/loud.cpp
Also clangd says there's too many errors and it doesn't do anything except for showing the error. no formatting etc.
Logs
Please attach the clangd log from the "Output" window if you can.
If possible, run with
--log=verbose
- note that the logs will include the contents of open files!System information
Clangd version (from the log, or
clangd --version
):clangd extension version: v0.1.29
Operating system: macos
The text was updated successfully, but these errors were encountered: