2.2 在Ubuntu Linux中运行C/C++ 2,2,3验证安装C和C+十编泽器 安装完后,可以用命令检查安装是否正确。 whereis gcc whereis g++ 这些命令可以查看gcC/g++命令及其使用说明页的 路径。 >下面的命令可以显示当前正在使用的编译器及其 which gcc which g++
2.2 在Ubuntu Linux中运行C/C++ 2.2.3 验证安装C和C++编译器 ➢ 安装完后,可以用命令检查安装是否正确。 whereis gcc whereis g++ 这些命令可以查看gcc/g++命令及其使用说明页的 路径。 ➢ 下面的命令可以显示当前正在使用的编译器及其 which 系统路径gcc which g++
2.2在Ubuntu七inux中运行C/C+ ●ros@ros-pc:- roseros-pc:-$whereis gcc gcc:/usr/bin/gcc /usr/lib/gcc /usr/share/man/man1/gcc.1.gz roseros-pc:-$ which gcc /usr/bin/gcc rosaros-pc:-$gcc --version gcc(Ubuntu5.4.0-6 ubuntu1=16.04.4)5.4.020160609 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. roseros-pc:-$whereis g++ g++:/usr/bin/g++/usr/share/man/manl/g++.1.gz rosaros-pc:-$which g++ /usr/bin/g++ roseros-pc:-$g++--version g++(Ubuntu5,4.0-6 ubuntu116.04.4)5.4.020160609 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. rosaros-pc:-$ 图2-2 在终端中测试验证安装命令
2.2 在Ubuntu Linux中运行C/C++ 2.2.3 验证安装C和C++编译器 ➢ 以下命令可以显示编译器的版本号 gcc version g++ version
2.2 在Ubuntu七inux中运行C/C++ 2.2.4 GNU项目调试器GDB简介 调试器是一个可以运行和控制另一个程序的程序, 通过检查每一行代码来检查程序的问题或Bug Ubuntu linux自带一个GNU Debugger的调试器,简称 GDB,是Linu系统最流行的调试器之一。 www.gnu.org/software/gdb/ 83
2.2 在Ubuntu Linux中运行C/C++ 2.2.4 GNU项目调试器GDB简介 调试器是一个可以运行和控制另一个程序的程序, 通过检查每一行代码来检查程序的问题或Bug Ubuntu linux自带一个GNU Debugger的调试器,简称 GDB,是Linu系统最流行的调试器之一。 www.gnu.org/software/gdb/
2.2在Ubuntu七inux中运行C/C++ 2.2.5 在Ubuntu Linux中安装GDB 最新版本已经安装GDB,如果是其他版本,可以用 如下命令安装 Sudo apt-get install gdb 8
2.2 在Ubuntu Linux中运行C/C++ 2.2.5 在Ubuntu Linux中安装GDB 最新版本已经安装GDB,如果是其他版本,可以用 如下命令安装 Sudo apt-get install gdb
2.2在Ubuntu七inux中运行C/C+ ros@ros-pc:- rosaros-pc:-$qdb GNU gdb (Ubuntu 7.11.1-0ubuntul-16.5)7.11.1 Copyright (C)2016 Free Software Foundation,Inc. License GPLv3+:GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software:you are free to change and redistribute it. There is NO WARRANTY,to the extent permitted by law.Type "show copying" and "show warranty"for details. This GDB was configured as "x86 64-linux-gnu". Type "show configuration"for configuration details For bug reporting instructions,please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help,type "help". Type "apropos word"to search for commands related to "word". gdb) 图23测试gdb命令 8
2.2 在Ubuntu Linux中运行C/C++ 2.2.6 验证安装GDB 为了检查GDB是否正确安装在计算机中,可以使用 以下命令 gdb 为在终端中输入GDB,则会显示图2-3所示信息