2015-11-12 46 views
2

所以,當我第一種類型的G ++在控制檯檢查,這是發生了什麼:克++被顯示爲已安裝後也易於得到安裝

[email protected]:~$ g++ 
The program 'g++' is currently not installed. You can install it by typing: 
sudo apt-get install g++ 

至於建議,我安裝了G ++(沒有sudo易於得到更新和-f在此之前)。

[email protected]:~$ sudo apt-get install g++ 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
g++ is already the newest version. 
0 upgraded, 0 newly installed, 0 to remove and 121 not upgraded. 

但是這表明,G ++安裝後,也這是我在命令行中得到再次:

[email protected]:~$ g++ 
The program 'g++' is currently not installed. You can install it by typing: 
sudo apt-get install g++ 

請幫幫忙! (我在Ubuntu 14.04上)。

編輯1 (響應評論)

sudo update-alternatives --config g++給出了這樣的輸出:

update-alternatives: error: no alternatives for g++

+1

試着問上http://askubuntu.com – Adam

+1

可能是'G ++'一些其他版本接手普通版本,然後移除。重新安裝'g ++'包可能會修復它。 –

+0

http://askubuntu.com/questions/513349/how-can-i-know-that-i-have-g-installed-in-my-ubuntu –

回答

1

嘗試使用

locate /usr/bin/g++ 

{時,這是過時的,使用 須藤updatedb的 }

我的Ubuntu系統目前顯示

:~$ locate /usr/bin/g++ 
/usr/bin/g++ 
/usr/bin/g++-4.9 
/usr/bin/g++-5 

下一頁使用

ls -lsa /usr/bin/g++ 

礦山顯示

0 lrwxrwxrwx 1 root root 5 Aug 1 14:32 /usr/bin/g++ -> g++-5 

所以,我的G ++是簡單地安裝G ++最新的鏈接。

也許此鏈接丟失或安裝不正確。

嘗試手動設置鏈接。

但在此之前,請直接調用它。

/usr/bin/g++-5 --version 

我的系統報告

g++-5 (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010 
Copyright (C) 2015 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
+0

我只是試圖設置g ++的符號鏈接爲g ++ - 4.8。這是問題所在。謝謝。 – AruniRC

-1

期待通過突觸,看看是否有相關的G ++任何東西,將其清除。