Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » -std=c++17 makes things worse instead of fixing them(indexing problem)
-std=c++17 makes things worse instead of fixing them [message #1814908] Sun, 22 September 2019 14:35 Go to next message
Alain Mosnier is currently offline Alain MosnierFriend
Messages: 1
Registered: September 2019
Junior Member
Hi,

I am using a "Makefile project in a directory containing existing code".

I ensure that the build command emits all g++ invocations in the console window, which I believe is necessary for the "CDT GCC Build Output Parser" mechanism to work properly.

It mostly works perfectly, including indexing.

I have gone though a few of the steps at vulkan-tutorial.com/.

When coming to step 5, vulkan-tutorial.com/code/05_window_surface.cpp, the indexing starts to partly fail: "Type 'std::optional<uint32_t>' could not be resolved".

When I get such an issue, I usually go to Project - Properties - Preprocessor Include Paths, Macros etc. - CDT GCC Built-in Compiler Settings and add "-std=c++17" (or whatever is applicable). When I do that now (${COMMAND} ${FLAGS} -std=c++17 -E -P -v -dD "${INPUTS}") and rebuild the index, instead of the problem being solved, the number of unresolved symbols just increases. The additional unresolved symbols have typically nothing to do with modern C++.

What I think is even weirder is that if I apply the same procedure to a minimal project that uses std::optional, that just works! I can also see that the __cplusplus symbol has the expected value in all cases (201703L when it should, 201402L otherwise), whether indexing works or not.

It looks like there is some kind of combination that breaks things. I have tried removing and adding code, and it seems that the combination std::set and std::optional is somehow involved.

How would I go about if I want to understand more about where the indexing goes wrong?

Also, is it possible the see what values ${COMMAND} and ${FLAGS} have?

Please note that in all cases above, the code builds and run without problem.

Thanks in advance.

Alain
Re: -std=c++17 makes things worse instead of fixing them [message #1814970 is a reply to message #1814908] Mon, 23 September 2019 15:00 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The $(COMMAND) is filled according to the selected toolchain .
You stll meed to select one even though it's a makefile project.
Or change it youself.

The $(FLAGS) is likely empty.

You can watch the builins collection by enabling
a console window at the bottom of the providers tab.
You could temporarily prepend an echo to see the coomand.

Other than that, tracking down Indrxer problems is difficult.
You could output a parser log for more info.
It's potentially quite large and minimally useful.
Re: -std=c++17 makes things worse instead of fixing them [message #1834786 is a reply to message #1814970] Tue, 17 November 2020 21:59 Go to previous message
Mario Charest is currently offline Mario CharestFriend
Messages: 4
Registered: July 2012
Junior Member
I'm having similar issue, with a makefile project.

I tried setting the __cplusplus symbol to 201703L, but the CDT seems to override it with it's auto discovery stuff.. Only solution I found was to edit the "Command to get compiler specs" and add -std=c++17 , but the issue with this solution is that it creates a .language.settings file that keeps changing all the time, on its own We have this file ignored by git but that means the C++17 setting is lost.

Google this issue, lead to various solution that seems to change for every release of Eclipse and for every type of project (managed, make etc). Obviously none of the solutions I found worked ;-)

Suggestions?
Previous Topic:Eclipse (2018-09) CDT project with Cygwin, can't debug the binary
Next Topic:Multiple "could not be resolved" problems
Goto Forum:
  


Current Time: Sat Oct 12 17:06:59 GMT 2024

Powered by FUDForum. Page generated in 0.26583 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top