Gcc: error trying to exec & #39; cc1plus & #39;: execvp: no such file or directory, cc1plusexecvp

Source: Internet
Author: User

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!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.