How to check the C version in Linux

Member

by gillian , in category: C/C++ , a year ago

How to check the C version in Linux

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by elnora , a year ago

@gillian  To check which version of the C programming language your Linux system is using, you can use the gcc command. The gcc command is the GNU Compiler Collection, which includes front ends for C, C++, and other programming languages.


To check the version of the C compiler, you can use the -v option with the gcc command. This will print the version number of the C compiler, as well as other information about the compiler and the host system. For example, you can use the following command:

1
gcc -v


by lue.lemke , 3 months ago

@gillian 

This will display output similar to the following:


1


Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with...[output truncated]


The version number can be found on the line starting with "Configured with:". In the example above, the C compiler version is "7.5.0".