Install g++-9 for c++20

8,076

Install g++ 8

sudo apt install g++-8

Run g++-8 with c++ 20 version.

g++-8 -std=c++2a text.c++ -o compiled
Share:
8,076

Related videos on Youtube

ar2015
Author by

ar2015

Here is full of fools.

Updated on September 18, 2022

Comments

  • ar2015
    ar2015 over 1 year

    I would like to run the full features of c++20 on g++. However, I need to install g++-9 for this purpose.

    Following the installation guides for old versions of g++ do not work for g++-9.

    Any hint?

    sudo apt install g++-9
    
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package g++-9
    E: Couldn't find any package by regex 'g++-9'
    

    .

    sudo apt install g++9
    
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Note, selecting 'libconfig9' for regex 'g++9'
    Note, selecting 'libaac-tactics-ocaml-ibg92' for regex 'g++9'
    Note, selecting 'libounit-ocaml-dev-afg95:i386' for regex 'g++9'
    Note, selecting 'libjpeg9-dbg' for regex 'g++9'
    Note, selecting 'libjpeg9-dev' for regex 'g++9'
    Note, selecting 'libreins-ocaml-dev-rpyg9' for regex 'g++9'
    Note, selecting 'libaac-tactics-ocaml-dev-ibg92' for regex 'g++9'
    Note, selecting 'libjpeg9' for regex 'g++9'
    Note, selecting 'libflac-ocaml-77yg9:i386' for regex 'g++9'
    Note, selecting 'libflac-ocaml-dev-77yg9:i386' for regex 'g++9'
    Note, selecting 'libaac-tactics-ocaml' instead of 'libaac-tactics-ocaml-ibg92'
    Note, selecting 'libaac-tactics-ocaml-dev' instead of 'libaac-tactics-ocaml-dev-ibg92'
    Note, selecting 'libreins-ocaml-dev' instead of 'libreins-ocaml-dev-rpyg9'
    Note, selecting 'libflac-ocaml:i386' instead of 'libflac-ocaml-77yg9:i386'
    Note, selecting 'libflac-ocaml-dev:i386' instead of 'libflac-ocaml-dev-77yg9:i386'
    Note, selecting 'libounit-ocaml-dev:i386' instead of 'libounit-ocaml-dev-afg95:i386'
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     libaac-tactics-ocaml : Depends: libcoq-ocaml-d91z1
                            Depends: ocaml-base-nox-4.02.3
                            Recommends: libaac-tactics-coq but it is not going to be installed
     libaac-tactics-ocaml-dev : Depends: camlp5-tli55
                                Depends: libcoq-ocaml-dev-d91z1
                                Depends: ocaml-nox-4.02.3
     libflac-ocaml-dev:i386 : Depends: libogg-ocaml-dev-465c2:i386
                              Depends: ocaml-nox-4.02.3:i386
                              Depends: libogg-ocaml-dev:i386 but it is not going to be installed
     libounit-ocaml-dev:i386 : Depends: ocaml-nox-4.02.3:i386
     libreins-ocaml-dev : Depends: ocaml-nox-4.02.3
    E: Unable to correct problems, you have held broken packages.
    
    • muru
      muru over 5 years
      GCC 9 hasn't been released yet.
    • ar2015
      ar2015 over 5 years
      @muru the reference says Range-based for statements with initializer | P0614R1 | 9 . Then how do they expect I test it?
    • muru
      muru over 5 years
  • Thomas Ward
    Thomas Ward about 4 years
    Can you explain a little bit how this answers OP's question/issue?