문제

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.

도움이 되었습니까?

해결책

save it with some name, e.g. filename.c and then call gcc and invoke the binary (named a.out by default)

gcc filename.c
./a.out
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top