Page 1 of 2

How : Language Server Clang && C++ 17

Posted: Thu Apr 02, 2020 6:26 pm
by seregads
Hi!
How can i set to clangd, that i`m using C++ 17?
Because, now it highlighting std::filesystem in code, but this code compiled w/o errors (with -std=c++17 flag).

Env info:
CodeLite 14.0
Windows 10 x64
MinGW 9.3 (from MSYS2)
Clangd 9.0.1 (from MSYS2)

Compile_flags.txt for project (maked by CodeLite):

-IC:\msys64\mingw64\include\c++\9.3.0
-IC:\msys64\mingw64\include\c++\9.3.0\x86_64-w64-mingw32
-IC:\msys64\mingw64\include\c++\9.3.0\backward
-IC:\msys64\mingw64\lib\gcc\x86_64-w64-mingw32\9.3.0\include
-IC:\msys64\mingw64\include
-IC:\msys64\mingw64\lib\gcc\x86_64-w64-mingw32\9.3.0\include-fixed
-IC:\msys64\mingw64\x86_64-w64-mingw32\include
-ID:\IAP20\calc_kernel\IAP_DLL
-target
x86_64-pc-windows-gnu

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 08, 2020 3:02 am
by eranif
basically, if you add this flag to the compile options, it should be added to the compile_flags.txt automatically
I will check this

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 08, 2020 3:49 am
by eranif
This seems like a bug in CodeLite.
It is fixed now in git master: https://github.com/eranif/codelite/comm ... 565e29a0b1

I will probably release 14.0.1 in the coming days so the fix should be available

Eran

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 08, 2020 11:04 am
by seregads
Thank you for check and fix.
Will wait for the 14.0.1 :)

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 22, 2020 1:30 pm
by seregads
I tried version 14.0.1, but result was negative - clangd doesn't know what is "filesystem"...
Where is problem?

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 22, 2020 1:32 pm
by seregads
And project setting in attached screenshot.

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 22, 2020 1:49 pm
by eranif
Don't you need to add std? or at least:

Code: Select all

using namespace std;
?

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 22, 2020 1:52 pm
by eranif
See below:
fs.png

Code: Select all

-IC:\compilers\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++
-IC:\compilers\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\x86_64-w64-mingw32
-IC:\compilers\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\backward
-IC:\compilers\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include
-IC:\compilers\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include-fixed
-IC:\compilers\mingw64\x86_64-w64-mingw32\include
-IC:\Users\Eran\Documents\HelloWorld\Console
-std=c++17
-target
x86_64-pc-windows-gnu

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 22, 2020 1:59 pm
by seregads
Hmmm...

Re: How : Language Server Clang && C++ 17

Posted: Wed Apr 22, 2020 2:04 pm
by seregads
or with full error info: