mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[GH-ISSUE #158] How to let TheIDE use higher version clang/gcc to parse C++ code in std=c++17/20 #68
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:




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.
@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:
@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?
@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:

So maybe TheIDE can do something like lsp with compile_commands.json.
@erusyd commented on GitHub (Aug 3, 2023):
I see TheIDE clang parser uses "/usr/include/c++/11/" as default path:

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

@erusyd commented on GitHub (Aug 3, 2023):
I successfully compiled my application with GCC builder with following settings:

But the parser begins to show a lot of errors:

What I suppose is that TheIDE libclang parser should work independently from builder mode selection.
@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:
@erusyd commented on GitHub (Aug 3, 2023):
I have tried this (even multiple -I{path}) and doesn't work:

@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@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:
@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.
@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:
@erusyd commented on GitHub (Aug 7, 2023):
Yes, It works for me. Thanks!