What are the most common C ++ compilers in Linux? [closed]

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 various distributions. I'm using CENTOS and I need to compile codes that use the new features of C ++ 14.

    
asked by anonymous 09.03.2018 / 21:17

1 answer

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 features of C ++ 14, use the -std=c++14 option to exclude extensions from GNU or -std=gnu++14 to include GNU extensions.

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, you would use g++ -std=c++14 or g++ -std=gnu++14 .

You can also look at Clang , but I do not know very well. It seems to support C ++ 14 since version 3.4 ( Clang C ++ Support ).

    
09.03.2018 / 22:37