gcc: error trying to exec 'cc1plus': execvp: no such file or directory,cc1plusexecvp

來源:互聯網
上載者:User

gcc: error trying to exec 'cc1plus': execvp: no such file or directory,cc1plusexecvp

  最近在安裝OpenCV cmake的時,出現gcc: error trying to exec 'cc1plus': execvp: no such file or directory的錯誤。

  導致問題的原因可能是因為沒有安裝 gcc 或者 g++,也可能是已安裝的 gcc 和 g++ 版本不相容 ,先解決方案如下:

   首先檢查 gcc 或者 g++ 是否已經安裝,若未安裝 sudo apt-get install gcc(g++)
   再用 gcc -v 和 g++ -v 分別檢查 gcc 和 g++ 的版本號碼, 看版本號碼是否一致,若不一致,請安裝同一個版本的gcc和g++。

  我遇到的問題是因為版本號碼不相容導致的(gcc 版本號碼為 4.8,g++ 版本號碼為 5.2)。
  所以需要將版本統一,將g++降為4.8版本的(sudo apt-get install g++-4.8),之後還需要ln連結一下。

  cd到/usr/bin目錄下(Ubuntu 64位):
    sudo  ln  -sf  g++-4.8  g++
    sudo  ln  -sf  g++-4.8  x86_64-linux-gnu-g++
    sudo  ln  -sf  gcc-4.8  gcc
    sudo  ln  -sf  gcov-4.8 gcov
    sudo  ln  -sf  gcc-4.28  x86_64-linux-gnu-gcc

 cmake 成功!

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.