怎么打开g++
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 10
- 注册时间: 2008-11-20 14:50
怎么打开g++
我装好g++后却不知道怎么打开它,还望各位能指点一下。
hekouren@hekouren-laptop:~$ which g++
/usr/bin/g++
hekouren@hekouren-laptop:~$ g++ -v
使用内建 specs。
目标:i486-linux-gnu
配置为:../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
线程模型:posix
gcc 版本 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
hekouren@hekouren-laptop:~$ g++
g++: 没有输入文件
hekouren@hekouren-laptop:~$ which g++
/usr/bin/g++
hekouren@hekouren-laptop:~$ g++ -v
使用内建 specs。
目标:i486-linux-gnu
配置为:../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
线程模型:posix
gcc 版本 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
hekouren@hekouren-laptop:~$ g++
g++: 没有输入文件
- ranfow
- 帖子: 176
- 注册时间: 2006-07-10 16:38
- 联系:
Re: 怎么打开g++
代码: 全选
ranfow@ranfow-laptop:~$ g++ --help
Usage: g++ [options] file...
Options:
-pass-exit-codes Exit with highest error code from a phase
--help Display this information
--target-help Display target specific command line options
--help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]
Display specific types of command line options
(Use '-v --help' to display command line options of sub-processes)
-dumpspecs Display all of the built in spec strings
-dumpversion Display the version of the compiler
-dumpmachine Display the compiler's target processor
-print-search-dirs Display the directories in the compiler's search path
-print-libgcc-file-name Display the name of the compiler's companion library
-print-file-name=<lib> Display the full path to library <lib>
-print-prog-name=<prog> Display the full path to compiler component <prog>
-print-multi-directory Display the root directory for versions of libgcc
-print-multi-lib Display the mapping between command line options and
multiple library search directories
-print-multi-os-directory Display the relative path to OS libraries
-print-sysroot-headers-suffix Display the sysroot suffix used to find headers
-Wa,<options> Pass comma-separated <options> on to the assembler
-Wp,<options> Pass comma-separated <options> on to the preprocessor
-Wl,<options> Pass comma-separated <options> on to the linker
-Xassembler <arg> Pass <arg> on to the assembler
-Xpreprocessor <arg> Pass <arg> on to the preprocessor
-Xlinker <arg> Pass <arg> on to the linker
-combine Pass multiple source files to compiler at once
-save-temps Do not delete intermediate files
-pipe Use pipes rather than intermediate files
-time Time the execution of each subprocess
-specs=<file> Override built-in specs with the contents of <file>
-std=<standard> Assume that the input sources are for <standard>
--sysroot=<directory> Use <directory> as the root directory for headers
and libraries
-B <directory> Add <directory> to the compiler's search paths
-b <machine> Run gcc for target <machine>, if installed
-V <version> Run gcc version number <version>, if installed
-v Display the programs invoked by the compiler
-### Like -v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
-S Compile only; do not assemble or link
-c Compile and assemble, but do not link
-o <file> Place the output into <file>
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension
Options starting with -g, -f, -m, -O, -W, or --param are automatically
passed on to the various sub-processes invoked by g++. In order to pass
other options on to these processes the -W<letter> options must be used.
For bug reporting instructions, please see:
<file:///usr/share/doc/gcc-4.3/README.Bugs>.
- netphi
- 帖子: 1051
- 注册时间: 2008-08-29 21:31
Re: 怎么打开g++
man一下g++来看看参数,g++只是一个带参数的gcc编译器,没有GUI界面。
你可以参考一下最简单的g++编译命令:
你可以参考一下最简单的g++编译命令:
代码: 全选
g++ -o filename filename.cpp
。。。。。。。。。。。。。
-
- 帖子: 10
- 注册时间: 2008-11-20 14:50
Re: 怎么打开g++
这个是帮助文件,可是还是不怎么懂啊。
比如说我用emacs 编辑了代码,怎么调用g++编译呢?
比如说我用emacs 编辑了代码,怎么调用g++编译呢?
-
- 帖子: 10
- 注册时间: 2008-11-20 14:50
Re: 怎么打开g++
谢谢你啊,解决了我一大疑问,我一直以后g++有gui界面的。netphi 写了:man一下g++来看看参数,g++只是一个带参数的gcc编译器,没有GUI界面。
你可以参考一下最简单的g++编译命令:代码: 全选
g++ -o filename filename.cpp
也说是使用它只能在终端里面吧
-
- 帖子: 10
- 注册时间: 2008-11-20 14:50
Re: 怎么打开g++
hekouren@hekouren-laptop:~$ g++ -0 filename filename.cppnetphi 写了:man一下g++来看看参数,g++只是一个带参数的gcc编译器,没有GUI界面。
你可以参考一下最简单的g++编译命令:代码: 全选
g++ -o filename filename.cpp
g++: filename:没有该文件或目录
g++: filename.cpp:没有该文件或目录
g++: 无法识别的选项‘-0’
g++: 没有输入文件
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
Re: 怎么打开g++
眼镜该换了hekouren 写了:hekouren@hekouren-laptop:~$ g++ -0 filename filename.cppnetphi 写了:man一下g++来看看参数,g++只是一个带参数的gcc编译器,没有GUI界面。
你可以参考一下最简单的g++编译命令:代码: 全选
g++ -o filename filename.cpp
g++: filename:没有该文件或目录
g++: filename.cpp:没有该文件或目录
g++: 无法识别的选项‘-0’
g++: 没有输入文件
^_^ ~~~
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
- netphi
- 帖子: 1051
- 注册时间: 2008-08-29 21:31
Re: 怎么打开g++
是 -o(字母o),不是-0(不是数字零),而且filename,一看就知道,指的是你的C++文件的名字。
emacs得调用make,我建议你先用vim,在~/.vimrc中加入:
以后在vim中一按F7就直接编译你的C++文件了,这个配置适合初学者。
emacs得调用make,我建议你先用vim,在~/.vimrc中加入:
代码: 全选
map <F7> :call CompileRunGplusplus()<CR>
func! CompileRunGplusplus()
exec "w"
exec "!g++ % -o %<"
exec "! ./%<"
endfunc
。。。。。。。。。。。。。
- yjcong
- 帖子: 2470
- 注册时间: 2006-02-28 3:11
-
- 帖子: 10
- 注册时间: 2008-11-20 14:50
Re: 怎么打开g++
能说得详细点吗?什么是眼镜,怎么换?谢谢BigSnake.NET 写了:眼镜该换了hekouren 写了:hekouren@hekouren-laptop:~$ g++ -0 filename filename.cppnetphi 写了:man一下g++来看看参数,g++只是一个带参数的gcc编译器,没有GUI界面。
你可以参考一下最简单的g++编译命令:代码: 全选
g++ -o filename filename.cpp
g++: filename:没有该文件或目录
g++: filename.cpp:没有该文件或目录
g++: 无法识别的选项‘-0’
g++: 没有输入文件
- netphi
- 帖子: 1051
- 注册时间: 2008-08-29 21:31
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
Re: 怎么打开g++
字面意思 =。=hekouren 写了:能说得详细点吗?什么是眼镜,怎么换?谢谢BigSnake.NET 写了:眼镜该换了hekouren 写了:hekouren@hekouren-laptop:~$ g++ -0 filename filename.cppnetphi 写了:man一下g++来看看参数,g++只是一个带参数的gcc编译器,没有GUI界面。
你可以参考一下最简单的g++编译命令:代码: 全选
g++ -o filename filename.cpp
g++: filename:没有该文件或目录
g++: filename.cpp:没有该文件或目录
g++: 无法识别的选项‘-0’
g++: 没有输入文件
^_^ ~~~
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
- liupingjing
- 帖子: 451
- 注册时间: 2007-11-29 17:31
Re: 怎么打开g++
楼主太酷了,崇拜……
PS:如果是真不知道的话建议先去找本书看看,或者在google里搜一下g++的用法
- yjcong
- 帖子: 2470
- 注册时间: 2006-02-28 3:11
-
- 帖子: 10
- 注册时间: 2008-11-20 14:50
Re: 怎么打开g++
哎,你们太搞笑了,原谅一下新手哈。谢谢你们