First of all, I know about the -std=c++11 flag to enable c++11 support and where to place it. I've appended -std=c++11
to Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous -> Other Flags
and compiling just works fine. But the indexer doesn't get along, for example if I want to use the emplace
function of std::map
(c++11), it will not find the emplace function.
#include <map>
int main() {
std::map<int, int> data;
data.emplace(5,5);
I've also checked out these related questions:
Update: Now that I've played around it even doesn't recognize the std::map type, although compiling fine and eclipse finding all headers...
In Eclipse, go to the "File" menu, then "New", then "C++ Project" if it's there. If not, choose "Project", then find "C/C++" in the list of wizards, click the "+" sign to expand it, and choose "C++ Project". A dialog box will ask whether to open the C/C++ perspective.
Eclipse Mars does it a bit differently than the previous versions.
Step one gets the indexer error highlighting working - covered in Enable C++11 in Eclipse CDT (Juno/Kepler/Luna) indexer linked above. If you've already done all this, I'll be smurfed if I know what you've run into. Mars has been a bit wonky so far.
By the way, if anyone knows where the global settings are so I can default this behaviour, please let me know.
Step 2 gets the compiler working
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With