Incorrect FAQ? CDT does not recognize C++11 features [message #908917] |
Thu, 06 September 2012 08:21 |
Joost Kraaijeveld Messages: 273 Registered: July 2009 |
Senior Member |
|
|
Hi,
The FAQ states:
"- Source navigation and symbol resolving
You should add the option -std=c++0x to the scanner discovery in Project
Properties->C/C++ Build ->discovery Options in the field "compiler
invocation arguments"."
However there is no such path in the CDT version 8.1. What is the
correct solution for this problem in 8.1?
--
Groeten,
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl
Cheers,
Joost
|
|
|
|
|
Re: Incorrect FAQ? CDT does not recognize C++11 features [message #909226 is a reply to message #909018] |
Thu, 06 September 2012 19:00 |
Joost Kraaijeveld Messages: 273 Registered: July 2009 |
Senior Member |
|
|
On 06-09-12 14:32, Andrew Gvozdev wrote:
> Project Properties->C/C++ General->Preprocessor Include Paths,
> Macros->[Providers] tab->your Built-in Compiler Settings provider
> (toolchain dependent).
> Click on "Workspace Settings" link which gets you to "Settings" property
> page, select [Discovery] tab and your provider again. There is "Command
> to get compiler specs", add "-std=c++0x" in there.
Thanks, although it does solve all problems. The example program from
http://en.cppreference.com/w/cpp/thread/thread/thread gives problems at
the lines 37/38:
std::thread t3(f2, std::ref(n));
std::thread t4(std::move(t3));
>
> I suppose there is some room for improvement on CDT side to make it easier.
Checkboxes for the compiler, like warning levels maybe? . And don't
forget other
things from the standard that requires flaggs, e.g. threads....
--
Groeten,
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl
Cheers,
Joost
|
|
|
|
|
|
|
|
Re: Incorrect FAQ? CDT does not recognize C++11 features [message #1112464 is a reply to message #1105885] |
Thu, 19 September 2013 18:56 |
Galen Brownsmith Messages: 3 Registered: August 2013 |
Junior Member |
|
|
Quote:So there is no way to set this globally?
If you followed the directions above, your change will persist for any other project in the same workspace using the same toolchain.
Which is still annoying, but is better than needing to set it per project.
You can export the workspace settings and re-import them for a new project to pass it along. Or you could keep a copy the languages.settings.xml file from $workspace/.metadata.plugins/org.eclipse.cdt.core and merge it into new workspaces.
(To restate the aforementioned instructions in a more step by step/verbose manner:
Open project properties.
Select the 'C/C++ General' subtree, then Preprocessor Include Paths branch.
Select the Providers tab. Then Built-in Compiler Settings provider. (The name of this weill be toolchain dependent. My usual option is "CDT GCC Built-in Compiler Settings" )
In the Language Settings Provider box, select the "Workspace Settings" hyperlink.
In the new settings window, change to the Discovery tab (if you're not already on it, but on Error Parsers).
Again, select the tool-chain dependent Built-in Compiler Settings.
In this window's Language Settings Provider Options window, add "-std=c++11" or -"std=c++0x" (without then quotes) to the command line somewhere before the '"${INPUTS}"' option (and make sure there are spaces on either side of the new parameter). )
(There are simpler ways, IMO, to get to that correct tab, but I'm just copying from above.)
Although, given that the C++11 standard is now over 2 years old (not to mention that first Technical Report was in 2007, and the '11 standard didn't add anything, IIRC), I'm really surprised that it isn't the default by now.
(This isn't to say that I've got indexing working right. std::[foo]_ptr, std::unordered_[map/set] and others are still failing to parse correctly. I'm very close to the point where I'm going to implement thin wrapper classes, just so the indexer issues stop.)
|
|
|
|
Powered by
FUDForum. Page generated in 0.04602 seconds