How can I know that which version of gcc compiler I am using?

11,577

In order to get that information you should type the commands: gcc -v or gcc --version. For more details see the man pages for gcc http://linux.die.net/man/1/gcc

Share:
11,577
Destructor
Author by

Destructor

Updated on June 05, 2022

Comments

  • Destructor
    Destructor almost 2 years

    In java, there is command line option javac -version to know the version that is installed on computer. I am curious to know about is there any way exist to know the version of gcc or any command line option that can help me?

    Remember I am not asking about language standards like C99, C11, C++11 etc. I am asking about compiler version like gcc 4.9.2 etc.

    • cristid9
      cristid9 almost 9 years
      Have you tried gcc -v?
    • Destructor
      Destructor almost 9 years
      @cristid9: yes, it works & provides detailed information. gcc --version also works & gives only version.
    • Destructor
      Destructor almost 9 years
      @Downvoters: Who downvoted? What's wrong with question?
    • cristid9
      cristid9 almost 9 years
      In general, you should read the man pages and try to figure out a thing on your own before asking a question. People really appreciate that. That's why I think you got a downvote.