umasuo—ubuntu G++的安装
刚刚想在ubuntu上安装一个花生壳,但是把花生壳下载下来以后想进行编译的时候出现了
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables See `config.log' for more details.
大仙是G++没有装好,于是就装了一次G++
ubuntu 不知道从哪个版本开始就自带了GCC,但是G++貌似没有,于是用
apt-get install g++
安装,出现下面错误:
The following packages have unmet dependencies: g++ : Depends: g++-4.6 (>= 4.6.3-1~) but it is not going to be installed google-chrome-stable : Depends: libxss1 but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
这个错误是因为有些需要的包没有
尝试使用
apt-get -f install
把欠缺的包安装完毕。
再次重试
apt-get install g++
安装成功
运行
g++ --version
显示以下信息:
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Copyright (C) 2011 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.
说明G++安装成功了。