[GH-ISSUE #158] How to let TheIDE use higher version clang/gcc to parse C++ code in std=c++17/20 #68

Closed
opened 2026-05-05 03:37:27 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @erusyd on GitHub (Aug 2, 2023).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/158

I have codes using C++17/20 libraries and TheIDE parsing shows errors:
scoped_lock
optional
atomic
format
I guess it's because TheIDE parsing uses c++14 standard. So how to let TheIDE use higher version clang/gcc with C++17/20 standards. I have gcc-13 installed via linuxbrew and clang-16 installed via ubuntu ppa.

image

Originally created by @erusyd on GitHub (Aug 2, 2023). Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/158 I have codes using C++17/20 libraries and TheIDE parsing shows errors: ![scoped_lock](https://github.com/ultimatepp/ultimatepp/assets/1529102/bb40a49f-1682-47b6-8205-851b55379ce3) ![optional](https://github.com/ultimatepp/ultimatepp/assets/1529102/01d9a0e3-dd8c-4a3b-9ead-7bf1a6fcf602) ![atomic](https://github.com/ultimatepp/ultimatepp/assets/1529102/8a64dc25-ff5e-41a9-a325-9bd69ae82944) ![format](https://github.com/ultimatepp/ultimatepp/assets/1529102/cb891aa9-dbd2-434f-b58c-d63c70623ac8) I guess it's because TheIDE parsing uses c++14 standard. So how to let TheIDE use higher version clang/gcc with C++17/20 standards. I have gcc-13 installed via linuxbrew and clang-16 installed via ubuntu ppa. ![image](https://github.com/ultimatepp/ultimatepp/assets/1529102/6c41f1a3-5663-456a-a3e0-7246cde57ac1)
Author
Owner

@mirek-fidler commented on GitHub (Aug 2, 2023):

Settings/Assist, bottom of window there are additional libclang commandline
parameters.

Adding "-std=c++17" there should help. (Please confirm).

Mirek

On Wed, Aug 2, 2023 at 10:50 AM Song Yadong @.***>
wrote:

I have codes using C++17/20 libraries and TheIDE parsing shows errors:
[image: scoped_lock]
https://user-images.githubusercontent.com/1529102/257753406-bb40a49f-1682-47b6-8205-851b55379ce3.png
[image: optional]
https://user-images.githubusercontent.com/1529102/257753413-01d9a0e3-dd8c-4a3b-9ead-7bf1a6fcf602.png
[image: atomic]
https://user-images.githubusercontent.com/1529102/257753415-8a64dc25-ff5e-41a9-a325-9bd69ae82944.png
[image: format]
https://user-images.githubusercontent.com/1529102/257753420-cb891aa9-dbd2-434f-b58c-d63c70623ac8.png
I guess it's because TheIDE parsing uses c++14 standard. So how to let
TheIDE use higher version clang/gcc with C++17/20 standards. I have gcc-13
installed via linuxbrew and clang-16 installed via ubuntu ppa.

[image: image]
https://user-images.githubusercontent.com/1529102/257755622-6c41f1a3-5663-456a-a3e0-7246cde57ac1.png


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/158, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH236PZZJB7FVJ324QVVLXTIIGTANCNFSM6AAAAAA3A5YHEI
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

<!-- gh-comment-id:1661985947 --> @mirek-fidler commented on GitHub (Aug 2, 2023): Settings/Assist, bottom of window there are additional libclang commandline parameters. Adding "-std=c++17" there should help. (Please confirm). Mirek On Wed, Aug 2, 2023 at 10:50 AM Song Yadong ***@***.***> wrote: > I have codes using C++17/20 libraries and TheIDE parsing shows errors: > [image: scoped_lock] > <https://user-images.githubusercontent.com/1529102/257753406-bb40a49f-1682-47b6-8205-851b55379ce3.png> > [image: optional] > <https://user-images.githubusercontent.com/1529102/257753413-01d9a0e3-dd8c-4a3b-9ead-7bf1a6fcf602.png> > [image: atomic] > <https://user-images.githubusercontent.com/1529102/257753415-8a64dc25-ff5e-41a9-a325-9bd69ae82944.png> > [image: format] > <https://user-images.githubusercontent.com/1529102/257753420-cb891aa9-dbd2-434f-b58c-d63c70623ac8.png> > I guess it's because TheIDE parsing uses c++14 standard. So how to let > TheIDE use higher version clang/gcc with C++17/20 standards. I have gcc-13 > installed via linuxbrew and clang-16 installed via ubuntu ppa. > > [image: image] > <https://user-images.githubusercontent.com/1529102/257755622-6c41f1a3-5663-456a-a3e0-7246cde57ac1.png> > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/158>, or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH236PZZJB7FVJ324QVVLXTIIGTANCNFSM6AAAAAA3A5YHEI> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> >
Author
Owner

@erusyd commented on GitHub (Aug 3, 2023):

Adding "-std=c++20" makes first three parsing errors gone, but "std::format" parsing error still exists. Maybe it's because the default libclang is 14? How to change TheIDE to use higher version clang?

<!-- gh-comment-id:1663208753 --> @erusyd commented on GitHub (Aug 3, 2023): Adding "-std=c++20" makes first three parsing errors gone, but "std::format" parsing error still exists. Maybe it's because the default libclang is 14? How to change TheIDE to use higher version clang?
Author
Owner

@erusyd commented on GitHub (Aug 3, 2023):

I changed My Emacs' lsp clangd from version 16 to version 14 and the syntax parsing of "std::format" is still OK:
image
So maybe TheIDE can do something like lsp with compile_commands.json.

<!-- gh-comment-id:1663292378 --> @erusyd commented on GitHub (Aug 3, 2023): I changed My Emacs' lsp clangd from version 16 to version 14 and the syntax parsing of "std::format" is still OK: ![image](https://github.com/ultimatepp/ultimatepp/assets/1529102/1ea7f911-15d6-4ceb-bd05-88b9169588ec) So maybe TheIDE can do something like lsp with compile_commands.json.
Author
Owner

@erusyd commented on GitHub (Aug 3, 2023):

I see TheIDE clang parser uses "/usr/include/c++/11/" as default path:
image

So is it possible to add include path to gcc-13 in the following location?
image

<!-- gh-comment-id:1663316308 --> @erusyd commented on GitHub (Aug 3, 2023): I see TheIDE clang parser uses "/usr/include/c++/11/" as default path: ![image](https://github.com/ultimatepp/ultimatepp/assets/1529102/46fc2131-f74c-429f-a9fe-261d2fa50edd) So is it possible to add include path to gcc-13 in the following location? ![image](https://github.com/ultimatepp/ultimatepp/assets/1529102/f5a0d534-6980-472a-ae04-3beffa171ae1)
Author
Owner

@erusyd commented on GitHub (Aug 3, 2023):

I successfully compiled my application with GCC builder with following settings:
image

But the parser begins to show a lot of errors:
image

What I suppose is that TheIDE libclang parser should work independently from builder mode selection.

<!-- gh-comment-id:1663323606 --> @erusyd commented on GitHub (Aug 3, 2023): I successfully compiled my application with GCC builder with following settings: ![image](https://github.com/ultimatepp/ultimatepp/assets/1529102/393a2ab6-0b8f-42ed-b595-d4d16ec72d6d) But the parser begins to show a lot of errors: ![image](https://github.com/ultimatepp/ultimatepp/assets/1529102/ce2f49ed-8668-493f-8f35-6cb3c49ecb56) What I suppose is that TheIDE libclang parser should work independently from builder mode selection.
Author
Owner

@mirek-fidler commented on GitHub (Aug 3, 2023):

Have you tried adding the correct path with -I in additional compiler
options?

(I will probably make all this experience smoother soon by providing C++
version selection in Assist dialog, but would be nice to know what
parameters to add there).

Mirek

On Thu, Aug 3, 2023 at 7:32 AM Song Yadong @.***> wrote:

I see TheIDE clang parser uses "/usr/include/c++/11/" as default path:
[image: image]
https://user-images.githubusercontent.com/1529102/258008972-46fc2131-f74c-429f-a9fe-261d2fa50edd.png

So is it possible to add include path to gcc-13 in the following location?
[image: image]
https://user-images.githubusercontent.com/1529102/258009312-f5a0d534-6980-472a-ae04-3beffa171ae1.png


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/158#issuecomment-1663316308,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH23ZAHAWOBK75SQUX3Y3XTMZVZANCNFSM6AAAAAA3A5YHEI
.
You are receiving this because you commented.Message ID:
@.***>

<!-- gh-comment-id:1663405384 --> @mirek-fidler commented on GitHub (Aug 3, 2023): Have you tried adding the correct path with -I in additional compiler options? (I will probably make all this experience smoother soon by providing C++ version selection in Assist dialog, but would be nice to know what parameters to add there). Mirek On Thu, Aug 3, 2023 at 7:32 AM Song Yadong ***@***.***> wrote: > I see TheIDE clang parser uses "/usr/include/c++/11/" as default path: > [image: image] > <https://user-images.githubusercontent.com/1529102/258008972-46fc2131-f74c-429f-a9fe-261d2fa50edd.png> > > So is it possible to add include path to gcc-13 in the following location? > [image: image] > <https://user-images.githubusercontent.com/1529102/258009312-f5a0d534-6980-472a-ae04-3beffa171ae1.png> > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/158#issuecomment-1663316308>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH23ZAHAWOBK75SQUX3Y3XTMZVZANCNFSM6AAAAAA3A5YHEI> > . > You are receiving this because you commented.Message ID: > ***@***.***> >
Author
Owner

@erusyd commented on GitHub (Aug 3, 2023):

I have tried this (even multiple -I{path}) and doesn't work:
image

<!-- gh-comment-id:1663442874 --> @erusyd commented on GitHub (Aug 3, 2023): I have tried this (even multiple -I{path}) and doesn't work: ![image](https://github.com/ultimatepp/ultimatepp/assets/1529102/4e7010ab-940b-4358-98b7-d3f0edf5db5f)
Author
Owner

@erusyd commented on GitHub (Aug 3, 2023):

Through my current exercises, commons ones are:
-Wall, -std=c++17/20, -fmodules-ts, pkg-config --cflags --libs xxx

<!-- gh-comment-id:1663454817 --> @erusyd commented on GitHub (Aug 3, 2023): Through my current exercises, commons ones are: -Wall, -std=c++17/20, -fmodules-ts, `pkg-config --cflags --libs xxx`
Author
Owner

@mirek-fidler commented on GitHub (Aug 3, 2023):

What is this? Working commandline or what?

On Thu, Aug 3, 2023 at 9:44 AM Song Yadong @.***> wrote:

Through my current exercises, commons ones are:
-Wall, -std=c++17/20, -fmodules-ts, pkg-config --cflags --libs xxx


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/158#issuecomment-1663454817,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH23342GMXGJC3JJRRNTLXTNJEFANCNFSM6AAAAAA3A5YHEI
.
You are receiving this because you commented.Message ID:
@.***>

<!-- gh-comment-id:1663671473 --> @mirek-fidler commented on GitHub (Aug 3, 2023): What is this? Working commandline or what? On Thu, Aug 3, 2023 at 9:44 AM Song Yadong ***@***.***> wrote: > Through my current exercises, commons ones are: > -Wall, -std=c++17/20, -fmodules-ts, pkg-config --cflags --libs xxx > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/158#issuecomment-1663454817>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH23342GMXGJC3JJRRNTLXTNJEFANCNFSM6AAAAAA3A5YHEI> > . > You are receiving this because you commented.Message ID: > ***@***.***> >
Author
Owner

@erusyd commented on GitHub (Aug 3, 2023):

These are just some gcc compile options in my makefile and use "bear -- make" to generate compile_commands.json.
For example, "pkg-config --cflags --libs gtkmm-4.0" will generate gtkmm related header and lib path.

<!-- gh-comment-id:1663946357 --> @erusyd commented on GitHub (Aug 3, 2023): These are just some gcc compile options in my makefile and use "bear -- make" to generate compile_commands.json. For example, "pkg-config --cflags --libs gtkmm-4.0" will generate gtkmm related header and lib path.
Author
Owner

@mirek-fidler commented on GitHub (Aug 5, 2023):

Please try to build the latest theide - I have added C++ standard selection
in the assist setup. Seems to work for me... (but I will be glad if you
confirm).

Mirek

On Thu, Aug 3, 2023 at 3:02 PM Song Yadong @.***> wrote:

These are just some gcc compile options in my makefile and use "bear --
make" to generate compile_commands.json.
For example, "pkg-config --cflags --libs gtkmm-4.0" will generate gtkmm
related header and lib path.


Reply to this email directly, view it on GitHub
https://github.com/ultimatepp/ultimatepp/issues/158#issuecomment-1663946357,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARH2354TER4UQBJXT7RBHDXTOOO3ANCNFSM6AAAAAA3A5YHEI
.
You are receiving this because you commented.Message ID:
@.***>

<!-- gh-comment-id:1666510894 --> @mirek-fidler commented on GitHub (Aug 5, 2023): Please try to build the latest theide - I have added C++ standard selection in the assist setup. Seems to work for me... (but I will be glad if you confirm). Mirek On Thu, Aug 3, 2023 at 3:02 PM Song Yadong ***@***.***> wrote: > These are just some gcc compile options in my makefile and use "bear -- > make" to generate compile_commands.json. > For example, "pkg-config --cflags --libs gtkmm-4.0" will generate gtkmm > related header and lib path. > > — > Reply to this email directly, view it on GitHub > <https://github.com/ultimatepp/ultimatepp/issues/158#issuecomment-1663946357>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AARH2354TER4UQBJXT7RBHDXTOOO3ANCNFSM6AAAAAA3A5YHEI> > . > You are receiving this because you commented.Message ID: > ***@***.***> >
Author
Owner

@erusyd commented on GitHub (Aug 7, 2023):

Yes, It works for me. Thanks!

<!-- gh-comment-id:1667063819 --> @erusyd commented on GitHub (Aug 7, 2023): Yes, It works for me. Thanks!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ultimatepp#68
No description provided.