Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C++ 11 headers issue
C++ 11 headers issue [message #1034561] Fri, 05 April 2013 15:32 Go to next message
Ernst Maurer is currently offline Ernst MaurerFriend
Messages: 29
Registered: January 2011
Junior Member

Hello,

I'm using MinGW and one of headers is <initializer_list>
it 's compiled successfully, but Eclipse parser can't parse this template correctly,
it doesn't highlight the include itself, then eclipse "sees" the header but shows the error: "Symbol 'initializer_list' could not be resolved"

I've opened initializer_list header and see that CDT highlights block (most of this header) as __GXX_EXPERIMENTAL_CXX0X__ is not defined:
"
...
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <bits/c++0x_warning.h>
#else // C++0x
...
"
I believed that compiler option -std=c++11 defines this, is not it? because compiler works without errors.
But CDT parser have started to work properly only when I added __GXX_EXPERIMENTAL_CXX0X__ into C++General/Paths and Symbols/Symbols
why?
Re: C++ 11 headers issue [message #1749879 is a reply to message #1034561] Tue, 13 December 2016 13:44 Go to previous messageGo to next message
Georg Georg is currently offline Georg GeorgFriend
Messages: 2
Registered: December 2016
Junior Member
Same problem here.
I use Eclipse CDT Neon, the toolchain is Linux GCC (version 5.4) with the "-std=c++11" flag.
The Eclipse parser sees an error (Symbol 'initializer_list' could not be resolved) whereas the code compiles and works perfectly fine.
Re: C++ 11 headers issue [message #1749911 is a reply to message #1749879] Tue, 13 December 2016 18:21 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
I tried reproducing the problem. When I changed the language standard:

index.php/fa/27857/0/

I was prompted to rebuild the index:

index.php/fa/27858/0/

After that the indexer behaved properly.

So there are a couple of things going on, perhaps sometime in the past "Remeber my decision" saved a No so you weren't prompted, or perhaps CDT didn't notice the setting change affected the index.

Either way, you should be able to resolve it by right-clicking on the project and choosing Index -> Rebuild.
Re: C++ 11 headers issue [message #1749912 is a reply to message #1749911] Tue, 13 December 2016 18:23 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
PS If you aren't getting the prompt when changing the setting, you can reset the Remember my decisions aka do not show again prompts in C/C++ Preference Page:

index.php/fa/27859/0/
  • Attachment: clear.png
    (Size: 54.98KB, Downloaded 1170 times)
Re: C++ 11 headers issue [message #1749926 is a reply to message #1749912] Tue, 13 December 2016 21:54 Go to previous message
Georg Georg is currently offline Georg GeorgFriend
Messages: 2
Registered: December 2016
Junior Member
@Jonah Graham: Great detailed answer, thank you very much! That solved my problem.

[Updated on: Tue, 13 December 2016 21:57]

Report message to a moderator

Previous Topic:Arduino plugin: Supported boards (Platforms): rfDuino
Next Topic:MSP430 no MCU targets
Goto Forum:
  


Current Time: Thu Apr 25 09:46:00 GMT 2024

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

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

Back to the top