LuaXD's blog

By LuaXD, 10 years ago, In English

I have heard that there are some issues when installing the 4.9 GCC release on any Linux distro. Is this true? In any case, can someone tell me how to install the 4.9 GCC release on any Linux distro? Thanks!

  • Vote: I like it
  • +7
  • Vote: I do not like it

»
10 years ago, # |
  Vote: I like it +5 Vote: I do not like it

The title says C++11 compiler. you don't have to install gcc4.9 to have most features of c++11. Just compile with --std=c++11

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I get the folowwing error message when trying to compile with --std=c++11: cc1plus: error: unrecognized command line option ‘--std=c++11’

    :(

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Well, what compiler do you use?

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I use GCC 4.6.3, but when I try to update it via terminal, I get a message telling me that I have the latest version.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Try -std=c++11 with one -

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I get the following error but with one -

        • »
          »
          »
          »
          »
          10 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          What ubuntu version do you use?

          • »
            »
            »
            »
            »
            »
            10 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I use elementary OS which is based on Ubuntu 12.04

            • »
              »
              »
              »
              »
              »
              »
              10 years ago, # ^ |
              Rev. 2   Vote: I like it 0 Vote: I do not like it

              I think all because of old Ubuntu 12.04 repos. I would recommend upgrading if you can.

              • »
                »
                »
                »
                »
                »
                »
                »
                10 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                As of now this version of Elementary OS is not upgradeable to any 14.04 repos. But thanks for your reply.

            • »
              »
              »
              »
              »
              »
              »
              10 years ago, # ^ |
                Vote: I like it +4 Vote: I do not like it

              use -std=c++0x, bro

              • »
                »
                »
                »
                »
                »
                »
                »
                10 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                That command does work, thanks! :)

»
10 years ago, # |
  Vote: I like it +1 Vote: I do not like it

You'd better use the following command in shell: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.7 g++-4.7

Then you can use the command g++ with the option -std=c++11 to compile the code in c++11 mode. Good luck