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
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