4
What are the most common free compilers on Linux to compile C++14? " Most common" in the sense of most used and available in several distributions. I am using CENTOS and need to compile code that uses the new C++14 features.
4
What are the most common free compilers on Linux to compile C++14? " Most common" in the sense of most used and available in several distributions. I am using CENTOS and need to compile code that uses the new C++14 features.
4
I use GCC (GNU Compiler Collection). GCC supports full C++14 since GCC 5 (GCC C++ Support - English). Almost all (if not all) Linux distributions support GCC.
To enable the new C++14 features, use the option -std=c++14
to delete GNU extensions or -std=gnu++14
to include extensions of GNU.
To compile C++, it is normal to call g++
, which is the same as calling gcc -xc++ -lstdc++ -shared-libgcc
(Difference between GCC and G++ - English). So to compile C++14, use g++ -std=c++14
or g++ -std=gnu++14
.
You can also look Clang, but I don’t know it very well. It seems that it supports C++14 since version 3.4 (Clang C++ Support - English).
Linux was compiled in GCC. The first tests of Linus Torvalds to know if the kernel worked at all was to see if GCC was able to compile the GCC source running on Linux. So I can say with great certainty that all Linux distributions can support GCC, but not all necessarily need to have a GCC package
@Jefferson, I didn’t say they all have a GCC package, I said almost all of them do. In my experience, it is rare to have a distribution that does not have a GCC package.
I don’t understand why I have a negative vote. There is an error in my answer?
The question is based on opinions, and this type of question usually has answers also based on opinions, which is not well accepted on this site. We want concrete questions and answers, not based on personal taste.
I didn’t give an opinion. I gave two compilers that support C++14 on Linux. I explained that I don’t really know one of the compilers, but I don’t understand how this is an opinion. Please what part of my answer is not concrete? Portuguese is my second language, so maybe I’m not understanding something subtle that changes the meaning of what I said.
By answering a question that is low quality and not well accepted on the site because it is based on opinions, you are encouraging others to do the same thing. Of course I speak only for myself, but maybe others use the same criteria.
I still don’t understand how the question is of opinion. I understood the question as "What options exist". Marcelo asked which "I can use", not which "I should use". Also, it does not seem fair to give negative votes to an answer just because the question was bad. I have seen bad questions that resulted in good answers. So which part of my answer seems opinion?
I don’t think the question is based on opinion either.
The question did not appeal to me. I found her very dependent on opinion, but that was my judgment. If the author or you know something I’m not noticing, then we can try to reopen it (lie, I’ve already given my position, I can’t vote to reopen it now). Long live the difference of opinion. I was a little more dramatic when I disagreed with the closure of another question, perhaps it is the case that it is also here: https://pt.meta.stackoverflow.com/q/6857/64969. Anyway, I see (now) this question as pertinent to the chat, as a really cool bar chat, not on the main website.
@Kylea I meant what you put in the first comment: GCC has it in almost every corner. I went into it by saying: "even if the distribution doesn’t help, it’s possible"
@Jeffersonquesado The question for me is, what are the mainstream compilers for C++14 on linux? It’s not my specialty, but I imagine there are a few (I wouldn’t even know which ones besides gcc and Clang). Now, yes, the question has terms that can pull opinions (see the other answer) but are editable. Another thing that seems "closed" to the question is that she bumps into the infamous questions of recommendations and lists. I don’t know if I’m being "dramatic" here :)
@bfavaretto was not dramatic, it was discreet xD. Well, then there is some ground for me to have the impression of being preferable to close. I hope a good edition so I can give my +1 on it.
@bfavaretto, thanks for giving the example of lists. I still do not believe the question is opinion, but it is a question that can generate a list.
@Jeffersonquesado I took it to the finish line. Kyle, yes, but I have my doubts. I preferred to call the community to debate.
Browser other questions tagged c++ linux c++14
You are not signed in. Login or sign up in order to post.
This question is being debated at the goal.
– bfavaretto