ALL,
I'm worjking under RHEL 8 with the latest (2021-09) Eclipse version 4.21.0.
I'd like to set a C++ standard to be c++11, since I need a compatibility with the RHEL7.
I tried to follow instructyion I found on a different SO questions but none was sufficient, since many options were removed in this latest Eclipse version.
Could someone please give me a way to set it up for the latest Eclipse release, please?
TIA!!
Related
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.
After some research, I figured SO is the site to ask this question.
When using CLion, I am using the latest compilers and debuggers in my projects, however, there is absolutely no information about which toolchain versions that CLion supports (except for some 2016, 2019 answers online, but CLion is updated frequently).
The only way to learn is to install the latest version possible (for example 10.2), and then and only then, I can see a string such as Only supported versions 8.x-9.x.. But I compile/install some of these tools. I don't want to go through a 45 minutes compilation process just to discover it is unsupported, and I should have compiled an older version. I can't find this information anywhere, and it changes with each update.
I apologize: I am adding c/c++ as tags, because the frequent users of CLion IDE might have more information about this rather then the subscribers of the clion tag.
The information about supported toolchains could be found in CLion Help and release notes
Windows toolchains
MacOS toolchains
Debugging
The tutorial is a good starting point to find useful information about the versions.
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.
I am using GCC to compile a C++ application on Ubuntu 13. I want to be able to use C++11 features in my code, but at the same time still be able to produce a binary that my users can run on older versions of Ubuntu.
If I compile on Ubuntu 13 with the latest version of GCC my binary will not run on Ubuntu 12 since glibc is not forward compatible:
(How compatible are different versions of glibc?)
What are my options?
Is this even possible without requiring my users to jump through massive hoops?
If not, what do my users have to do to be able to run the binary (i.e. can they install the newer glibc on the older version of Ubuntu)?
Note: I don't not want to consider statically linking glibc since:
I've read that this is a very bad idea
Licensing issues
Cross-distribution compatibility issues
Currently my application does not use any C++11 features and I compile on an older version of Ubuntu with an older version of GCC to avoid this problem. But it makes me sad not being able to use the latest and greatest language features :(
You can try to use Boost Libraries which have quite the same features as C++11 and is "more retro-compatible" than C++11 : it will easily compile on older version of Ubuntu.
Otherwise the best option might be to ask to the users of Ubuntu 12.04 to upgrade there GCC from 4.6 to 4.7 or more recent :
http://www.swiftsoftwaregroup.com/upgrade-gcc-4-7-ubuntu-12-04/
You are asking "how do I use code that isn't on older systems".
The answer is of course, "Include the code with your project".
If you think through what you're asking, you'll realize that in any case, you'll need the code for the c++11 functions in libstdc++. So if they aren't on ubuntu 12, YOU have to add them. Therefore, you'd have to have it statically linked. it's the only way to ensure it will run on an arbitrary ubuntu12 system.
Well you could make a fancy installation, but in the end, it'd just be your apps "dynamically linking" to the libstdc++, so it may as well be statically linked, since no other program is going to be looking for it on ubuntu12
In general, a c++ library is compatible only if the same compiler is used and (!) the versions of the compilers are matching (you might be lucky, though). There is no way to be portable in this sense, besides writing C-code.
I have project that is at times developed on Windows/Visual Studio 2010 and uses some C++11 features and I need to be able to develop/build on Mac OS X. When I tried to build the project with Xcode I got a lot of errors around new C++11 features and checked the gcc version to find it's pretty old (4.2).
It looks like Apple is trying to force developers to pay an unnecessary upgrade to Lion by refusing to allow Xcode 4+ to be downloaded on any other version of Mac OS thus I'm left with Xcode 3.x.
How can I continue to use C++11 on Snow Leopard? Is there a way I can do this and keep Xcode as an IDE?
Update feb.25 2012: There are now a lot of features available for you to work with using the latest clang. Maybe you could target 10.6 if you use language features only. If you need library features, you will need 10.7.
given the present (sept.24.2011) state of the Xcode toolset, it's easiest (IMO) to choose another ide or os if you need c++11 support.
the fork of gcc xcode uses will never support these features. clang is pretty far behind wrt c++11 features (because its c++ implementation is still very new and other compilers have had a few extra years). therefore, the compilers xcode ships with do not presently support enough features for c++11 development, regardless of the version of osx you use.
you can install a newer version of gcc and use another ide fairly easily.
technically, you can also make a plugin for xcode 3 (not officially supported) which invokes another compiler (e.g. a more recent release of gcc). that route has been closed in xc4 (afaik). Update apparently, it's still available in Xc4; see idljarn's comment below.
for many projects, it's easier to just use your mac to boot into linux or windows (or use virtualization).
your final option is intel's compiler, which can be used in xcode and provides a decent amount of c++11 support -- try it with xcode before you buy to see if it fits your needs, plays well with xcode, and supports the c++11 features your team uses.
lastly, i don't think they do this for your upgrade money. they really don't maintain xcode for multiple releases very well - they just expect you to stay with the latest and greatest unless you need backwards compatibility; you just stop upgrading in that case. they invested in and assisted development of clang after gcc's license changed. so yeah... osx has always been very far behind wrt c++11 support because they decided to switch to another (very young) compiler. if you wait for xcode to support c++11, you will have to wait for clang to support it, which can be quite some time.
I just saw this now and I would like to update you on this. LLVM currently shipping with XCode is at version 3 (Source). This current version is very good with supporting C++11. Here is a link to what is supported:
http://clang.llvm.org/cxx_status.html
You can compare this with the current GCC support here:
http://gcc.gnu.org/projects/cxx0x.html
As you can see, Clang is currently not far behind, if it is at all, with features of the new standard being supported. The only thing that I see concerning is the lack of support for concurrency features, but that is the case for most C++11 compilers due to the nature of supporting it.So I hope that this answer is not too late and that you are not deterred. Go get the latest version of Xcode and fire away (If you have not done so already ;) )!