如何使用 GNU 工具链学习 C 编程?
我是编程新手,对 Linux 更陌生。有人告诉我,Linux 是学习编程的最佳操作系统,因为它可以让程序员与机器架构紧密交互。我听说过很多关于 GNU 工具链的信息,它提供了 Linux 上最好的编程环境,所以我决定不使用 IDE,并投入尽可能多的时间来以正确的方式学习东西。
我刚刚安装完 Ubuntu 10.10。我安装了 Vim 并开始学习将它用于我的文本编辑器。我还能够验证 GCC 和 GDB 是否存在于我的系统上。 我正在从书中学习 C 编程 - 计算机科学:使用 C 的结构化编程方法。虽然它解释了如何使用编辑器、编译器、链接器和运行器来开发和运行程序,但它没有解释如何设置和使用它们。所以我的问题是,一旦我在文本编辑器中编写了源代码,如何调用 GNU 工具链来编译和运行我的程序。
I am new to programming, and even newer to Linux. I was told that Linux is the best OS to learning to program as it lets a programmer interface closely with the machine architecture. I heard a lot about the GNU tool-chain and that it provides the best programming environment on Linux so I decided I won't use an IDE and put in as much time is needed to learn things the right way.
I have just finished installing Ubuntu 10.10. I installed Vim and started learning to use it for my text-editor. Also I have been able to verify that GCC and GDB are present on my system.
I am learning to program in C from the book - Computer Science: A Structured Programming Approach using C. Though it explains how editor, compiler, linker and runner are used to develop and run programs, it doesn't explain how to set them up and use them. So my question is, once I have the source-code written in my text-editor, how do I invoke the GNU tool-chain to compile and run my program.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用某个名称保存它,例如 filename.c,然后调用 gcc 并调用二进制文件(默认情况下名为 a.out)
save it with some name, e.g. filename.c and then call gcc and invoke the binary (named a.out by default)