How : Language Server Clang && C++ 17

General questions regarding the usage of CodeLite
seregads
CodeLite Enthusiast
Posts: 15
Joined: Thu Apr 02, 2020 6:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

How : Language Server Clang && C++ 17

Post by seregads » Thu Apr 02, 2020 6:26 pm

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

User avatar
eranif
CodeLite Plugin
Posts: 6132
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Wed Apr 08, 2020 3:02 am

basically, if you add this flag to the compile options, it should be added to the compile_flags.txt automatically
I will check this
Make sure you have read the HOW TO POST thread

User avatar
eranif
CodeLite Plugin
Posts: 6132
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Wed Apr 08, 2020 3:49 am

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
Make sure you have read the HOW TO POST thread

seregads
CodeLite Enthusiast
Posts: 15
Joined: Thu Apr 02, 2020 6:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by seregads » Wed Apr 08, 2020 11:04 am

Thank you for check and fix.
Will wait for the 14.0.1 :)

seregads
CodeLite Enthusiast
Posts: 15
Joined: Thu Apr 02, 2020 6:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by seregads » Wed Apr 22, 2020 1:30 pm

I tried version 14.0.1, but result was negative - clangd doesn't know what is "filesystem"...
Where is problem?
You do not have the required permissions to view the files attached to this post.

seregads
CodeLite Enthusiast
Posts: 15
Joined: Thu Apr 02, 2020 6:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by seregads » Wed Apr 22, 2020 1:32 pm

And project setting in attached screenshot.
You do not have the required permissions to view the files attached to this post.

User avatar
eranif
CodeLite Plugin
Posts: 6132
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Wed Apr 22, 2020 1:49 pm

Don't you need to add std? or at least:

Code: Select all

using namespace std;
?
Make sure you have read the HOW TO POST thread

User avatar
eranif
CodeLite Plugin
Posts: 6132
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif » Wed Apr 22, 2020 1:52 pm

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
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread

seregads
CodeLite Enthusiast
Posts: 15
Joined: Thu Apr 02, 2020 6:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by seregads » Wed Apr 22, 2020 1:59 pm

Hmmm...
You do not have the required permissions to view the files attached to this post.

seregads
CodeLite Enthusiast
Posts: 15
Joined: Thu Apr 02, 2020 6:17 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by seregads » Wed Apr 22, 2020 2:04 pm

or with full error info:
You do not have the required permissions to view the files attached to this post.

Post Reply