ubuntu12.04 LTS,预安装了C++编译器么?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
c_++
帖子: 4
注册时间: 2014-02-11 16:11
系统: metsupp any

ubuntu12.04 LTS,预安装了C++编译器么?

#1

帖子 c_++ » 2014-02-11 16:19

代码: 全选

ubuntu@ubuntu:~$ cat a.cc  | nl
     1	#include <iostream>
       
     2	int main()
     3	    {      
     4	        return 0;
     5	    }
ubuntu@ubuntu:~$ 
ubuntu@ubuntu:~$ g++ a.cc 
程序 'g++' 已包含在下列软件包中:
 * g++
 * pentium-builder (You will have to enable component called 'universe')
请尝试:sudo apt-get install <选定的软件包>


用什么命令安装C++编译器?
头像
月下叹逍遥
论坛版主
帖子: 33994
注册时间: 2010-10-07 14:23
系统: Archdows10
来自: 某系某星某洲某国某省某市
联系:

Re: ubuntu12.04 LTS,预安装了C++编译器么?

#2

帖子 月下叹逍遥 » 2014-02-11 16:31

sudo apt-get install g++
浮生七十今三十,从此凄惶未可知
grey_ubuntu
帖子: 9
注册时间: 2013-03-09 20:21
系统: Ubuntu 14.04

Re: ubuntu12.04 LTS,预安装了C++编译器么?

#3

帖子 grey_ubuntu » 2014-02-12 21:33

只用c,c++不懂,但是gcc不就支持C++吗?
gcc是预装了的,终端输入gcc -v可以查看版本信息。如下:
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
目标:i686-linux-gnu
配置为:../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
线程模型:posix
gcc 版本 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
头像
cuihao
帖子: 4793
注册时间: 2008-07-24 11:33
来自: 郑州
联系:

Re: ubuntu12.04 LTS,预安装了C++编译器么?

#4

帖子 cuihao » 2014-02-12 21:57

grey_ubuntu 写了:只用c,c++不懂,但是gcc不就支持C++吗?
gcc是预装了的,终端输入gcc -v可以查看版本信息。如下:
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
目标:i686-linux-gnu
配置为:../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
线程模型:posix
gcc 版本 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
要区分 GNU Compiler Collection 和 GNU C Compiler。
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 绿
Site: CUIHAO.TK    Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
回复