Compile error: “g++: error trying to exec 'cc1plus': execvp: No such file or directory”

后端 未结 9 1663
情深已故
情深已故 2020-12-04 20:52

When I compile C/C++ program with popen in php... I got this error:

g++: error trying to exec \'cc1plus\': execvp: No such file or          


        
9条回答
  •  眼角桃花
    2020-12-04 21:28

    Something went wrong with your GCC installation. Try reinstalling the it like this:

    sudo apt-get install --reinstall g++-5
    

    In Ubuntu the g++ is a dependency package that installs the default version of g++ for your OS version. So simply removing and installing the package again won't work, cause it will install the default version. That's why you need to reinstall.

    Note: You can replace the g++-5 with your desired g++ version. To find your current g++ version run this:

    g++ --version
    

提交回复
热议问题