Gcc: error trying to exec 'cc1plus ': execvp: no such file or directory, cc1plusexecvp
Recently, when installing OpenCV cmake, the gcc: error trying to exec 'cc1plus ': execvp: no such file or directory error occurs.
The cause may be that gcc or g ++ is not installed, or the installed gcc is incompatible with g ++. The solution is as follows:
First, check whether gcc or g ++ has been installed. If sudo apt-get install gcc (g ++) is not installed)
Use gcc-v and g ++-v to check the version numbers of gcc and g ++ respectively to check whether the version numbers are consistent. If they are different, install gcc and g ++ of the same version.
The problem I encountered was caused by incompatibility of the version number (gcc version 4.8, g ++ version 5.2 ).
Therefore, you need to unify the version, downgrade g ++ to version 4.8 (sudo apt-get install g ++-4.8), and then link ln.
Cd to the/usr/bin directory (Ubuntu 64-bit ):
Sudo ln-sf g ++-4.8g ++
Sudo ln-sf g ++-4.8 x86_64-linux-gnu-g ++
Sudo ln-SFP gcc-4.8 gcc
Sudo ln-sf gcov-4.8 gcov
Sudo ln-sf gcc-4.28 x86_64-linux-gnu-gcc
Cmake successful!