Archlinux user using Emacs as a C++ IDE with the following setup : company / flycheck / lsp-ui / ccls
I'm trying to use filesystem
library from c++17 for personal use but I can't get rid of this error in Emacs
ccls : no member named 'filesystem' in namespace 'std'
A quick sample of my problem
#include <iostream>
#include <filesystem>
int main(int argc, char** argv) {
std::filesystem::path filePath("./sample.cpp");
std::cout << filePath.filename() < std::endl;
return 0;
}
Compilation and runtime are totally fine using this command :
clang++ -std=c++17 sample.cpp
Output : "sample.cpp"
But the "error" is still present inside Emacs which is kind of annoying. I tried to add .ccls
file with the following content but that doesn't solve the problem.
clang++
%cpp -std=c++17 ; Also tried with gnu++17
Here a screenshot of the problem. Error with cout
and filePath
are consequences of the first one I guess because everything is good in general
Does anybody know how to solve the problem ?
.ccls
file works. If you check out the buffer*ccls::stderr*
, do you see a line like22:14:20 ccls project.cc:284 I use /home/geza/st/.ccls: clang++ %cpp -std=c++17
? Btw., you can try thecompile_commands.json
way, it is easy to use, if you usebear
to generate it. – Mcalpineclang failed with error 1: /usr/bin/clang -fsyntax-only -Xclang -code-completion-macros -x c++ -Xclang -code-completion-at=-:8:6 -
I tried to generatecompile_commands.json
file withbear
and themakefile
i'm using but it does solve the problem. – Caneghemterminal
.$ ccls -index=$PWD
in the top level project path where.ccls
exists. and as @Mcalpine wrote, you should read... I use */.ccls ...
. I think your project setup isn't correct, so .ccls is in the wrong place or you selected another project path. – Macnair(lsp-describe-session)
to see that every thing is OK. – Macnair