Eclipse Luna Indexer for C++14 with custom makefile - c++

I currently have a C++ project with a custom makefile. I tell eclipse to simply call make and the makefile handles everything. The project builds fine but eclipse keeps highlighting generalized lambda captures as "syntax errors". As far as I understand from this:
https://stackoverflow.com/a/835019/4076418 ,
it's a problem with the CDT Indexer not understanding the C++14 syntax.
I've tried following the answers here:
Eclipse CDT C++11/C++0x support
https://stackoverflow.com/a/13635080/4076418
but they don't handle my case which is Eclipse Luna + a custom makefile project + c++14.
This question is probably related to mine but it has no answer [I also don't have the ability to change the indexer]:
https://stackoverflow.com/q/24950192/4076418
Any ideas on how to get the indexer to recognize c++14 features?
P.S. C++11 features aren't highlighted as syntax errors for some reason. I should also note that I'm using clang 3.4.2 in the makefile; obviously, it supports c++14. The g++ version available though is 4.4.7 so it doesn't support c++14. Could this be the problem somehow? That the CDT uses the system's g++ for the indexer? And if so, how do I change that without having to update g++ (I'm working with limited user privileges and updating it would be a pain)?

AFAIK Eclipse Luna does not support C++14 overall. You will probably need to upgrade to Eclipse Neon. I use neon, the parser works, I don't use custom makefile though
I have used Luna in the past, but even C++11 support was sometimes hard to setup.

Related

How can Eclipse CDT Indexer be configured, in order to recognize all the new features in C++20 and above

Current version (2022-03 (4.23.0)) of Eclipse CDT indexer does not recognize new features which are included in C++20 and above, like Concepts.
This results in:
Not being able to view the keywords (and possibly other parts) of those features in highlighted mode.
While the compiler is OK with those features, Eclipse editor identify them as syntax errors where ever they are defined/declared and also mark them as errors (with a red line under them) where ever they are used
This is a similar question to Eclipse CDT Indexer does not fully recognize c++11
and Eclipse CDT indexer does not know C++11 containers
How ever the version of C++ is different and I have tested all of the suggestions in the answers for those questions and none of them worked for this particular case.
More over, I am after a more general solution. I also remember having a similar issue with a new C++ feature in an older Eclipse version, which was solved with the newer versions of Eclipse.
Considering this lag of conformity with new standards of the language, is there any solution/work-around which could potentially solve the issue from now on?
I also appreciate any solution for this particular case, C++ Constraints and concepts https://en.cppreference.com/w/cpp/language/constraints.

Eclipse CDT C++20 Support

is there a way to enable support of C++20 features in Eclipse 2020-03 (CDT 9.11)? I mean to get rid of incorrect syntax highlighting like igroring newly added keywords like 'concept', 'requires' and others as defined in C++20 standard? I have a GCC10 supporting those stuff installed and in usage, so the code is built without any troubles but Eclipse CDT still complains about it...
Thanks to anyone willing to advise. Martin
There's no support for C++20 in Eclipse CDT. Actually the support to C++17 is quite high but not totally completed yet. If you need C++20 support is better to use another IDE at the moment or implement the support in CDT if you want.

Can Eclipse be configured to support C++14?

Forgive me if this is trivial, but I'm trying to get back to C++ after a long time and am having trouble configuring Eclipse Oxygen 4.7.1a to support C++14. Is it possible to enable C++14 support in Eclipse at all?
The April 2017 Eclipse newsletter states that "CDT's support for C++14 is a work in progress", but I don't know if this still holds.
Here's what I tried. Under File → Properties → C/C++ Build → GCC C++ Compiler → Dialect, there's a built-in setting where I set Language standard to ISO C++1y (-std=c++1y), but this doesn't seem to help as even features such as std::shared_ptr are not recognized by Eclipse. I tried entering -std=c++14 into Other dialect flags, but to no avail. I also tried the proposed solutions in this answer, but again with no success.
I have gcc 5.4.0.
Is it possible to get C++14 working with Eclipse Oxygen?

Incorrect C++ Autocompletion in NetBeans IDE 8 using MinGW/Cygwin

I am using the following combination for C++ development:
Microsoft Windows 8.1 x64
MinGW Distro 11.6
Cygwin 1.7.28
NetBeans IDE 8.0
First of all: I am able to compile source code both with MinGW and with Cygwin. The problem I describe in this question is related to both environments (or NetBeans).
Depending on the C++ standard to use for the project (see screenshot), the autocompletion doesn't work correctly in NetBeans IDE. In addition the behaviour of the autocompletion isn't consistent between using MinGW and Cygwin.
If using C++98 with MinGW Distro, the "new" language features of C++11 aren't auto-completed (correct behaviour):
If using C++11 with MinGW Distro, the "new" language features of C++11 are auto-completed, but std::vector (maybe some others too) isn't fully autocompleted (incorrect behaviour):
If using Cygwin, I am unable to get autocompletion to work correctly with std::vector at all, regardless of the C++ standard choosen in the IDE.
Therefore I assume that the problem is maybe related to some missing or superflucios macro definitions in the NetBeans IDE configuration for each environment.
Again: I am able to compile the code, regardless of the auto completion errors.
What can cause the problem described?
Do you know a solution for the problem?
I already asked a similar question here some time ago. The problems described there seem to be fixed in NetBeans IDE 8.0, since new C++11 features are detected properly.
Update 1 has been released to NetBeans 8.0, which fixes many bugs according C++11 and it's code assistance. You can see the fixed bugs here. Please update and test again.

Why can't Eclipse find regex on Mac OSX?

I'm using Eclipse Juno on OSX Mountain Lion and wanted to use std::regex, which I know is a C++11 only feature. When I #include <regex> the IDE says it doesn't exist. Maybe it's good to note that the header regex.h is present /usr/include/, though I see no specific library for it in /usr/lib/ or /usr/local/lib/, though I'm not aware if that's relevant. This is just a side project for fun so I'm not using a customized build system, just a regular C++ project in Eclipse.
I'm not real experienced when it comes to modifying a build process (other than setting include paths, libraries, etc.), especially when an IDE like Eclipse is driving it, but my assumption is that the compiler and linker (GCC G++) isn't configured for C++11, though I've tried various recommendations from SO and the Eclipse forums, like adding -std=c++11, but I just keep seeing output saying that they're unrecognized arguments.
I'm sure someone out there has dealt with this issue. Can anyone help? Thanks in advance.
On mac you have to use the flag:
-stdlib=libc++
and even then I believe generally only clang is updated enough(so use clang instead of gcc), if you've just been using the Xcode updates. You should also make sure that your Xcode command line tools are updated, because I would guess that is the compiler eclipse is using.