Search code examples
g++condaminiconda

How to install g++ on Conda under Linux?


I have tried

conda install -c conda-forge gcc

but it only installed gcc. I also need g++.


Solution

  • Narrow Solution

    It ships under the package name gxx:

    conda install -c conda-forge gxx
    

    Recommended Specification

    Generally, I prefer using the Conda Forge compilers package or one of its subpackages (e.g., cxx-compiler), as this specification works across platforms. For example, cxx-compiler will install g++ on Linux, clang++ on OSX, and vc on Windows:

    conda install -c conda-forge cxx-compiler