我的C语言开发环境
我的C语言开发环境
- 操作系统 Windows 10
- 虚拟工具 VMWARE 15
- 虚拟系统 Ubuntu Desktop 18.04 LTS
uname -a
Linux ubuntu 5.4.0-150-generic #167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
- 编辑器 Emacs 25
emacs --version
GNU Emacs 25.2.2
Copyright (C) 2017 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
- C语言编译器 GCC 7
gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 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.
- C语言调试器 GDB 8
gdb --version
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 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".
- 内存检测工具 Valgrind 3
valgrind --version
valgrind-3.13.0
- 多源文件编译工具 Make 4
make --version
GNU Make 4.1
为 x86_64-pc-linux-gnu 编译
Copyright (C) 1988-2014 Free Software Foundation, Inc.
许可证:GPLv3+:GNU 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/gpl.html>。
本软件是自由软件:您可以自由修改和重新发布它。
在法律允许的范围内没有其他保证。
- 写个 Hello World
/* filename: hello.c */
#include <stdio.h>
/**/
int
main (int argc, char *argv[])
{
printf ("Hello world!\n");
return 0;
}
/* --(:-o-:)-- */
- 编译运行
gwsong@ubuntu:~/works/zoo$ gcc hello.c -o hello
gwsong@ubuntu:~/works/zoo$ ./hello
Hello world!
至此,基本完成环境搭建,编译运行也顺利完成,下一步接着捡C语言基本语法相关的东西。

浙公网安备 33010602011771号