Simple C Program on Linux
Most of us have learnt C programming in Windows platform. In Windows,…
Linux is an open-source operating system, but most developers prefer to use Windows or Mac OS X because of its simplicity and speed. If you are a beginner then it is not an easy task to learn C Programming on Linux because the basic concepts of C Programming are different than the concept of other programming languages.
If you want to learn C Programming, then you need to install the GCC compiler and GNU C library. After installing these two tools, you need to download the “Hello World” program from the Internet and compile it using the GCC compiler.
If you are working on a C program on Linux and don’t know the path to run the program, then you should try the below-mentioned command line.
1. Install XCODE IDE
Xcode is a powerful Integrated Development Environment for Apple devices and Mac OS X. It is used by millions of developers and has a large community of users. So, if you want to create applications on iPhone, iPad, and Mac OS X, then you need to install Xcode on your system.
2. Install GCC compiler
GCC is a free and open source GNU Compiler Collection which is used to create programs in C language. So, if you want to run a C program on Linux, then you should install GCC compiler on your system.
3. Install LLVM compiler
LLVM is a collection of tools to produce code from an abstract syntax tree. It is the new compiler technology for the LLVM compiler family. So, if you want to compile a C program on Linux, then you should install LLVM compiler on your system.
4. Install clang compiler
clang is the tool for the Clang family of compilers. It is a C and C++ compiler designed for the LLVM project. So, if you want to compile a C program on Linux, then you should install clang compiler on your system.
5. Install GNU C library
GNU C Library is the standard C library for the GNU Project. It provides the same services as the standard C library. So, if you want to run a C program on Linux, then you should install GNU C library on your system.
6. Install C Runtime library
The C runtime library is a library of functions used by the C programming language. It includes support for execution of C code, control over memory allocation, etc. So, if you want to run a C program on Linux, then you should install C Runtime library on your system.
7. Install gdb debugger
GDB is the GNU Debugger. It is a debugging and profiling software for the GNU C and C++ languages. It provides interactive debugging capabilities and is used for development and testing of the GNU C and C++ languages. So, if you want to debug a C program on Linux, then you should install gdb debugger on your system.
8. Install make utility
Make is a simple program used for compiling a program from a series of Makefiles. If you want to compile a C program on Linux, then you should install make utility on your system.
9. Install Eclipse
Eclipse is a cross-platform integrated development environment. It is a widely used, open-source integrated development environment (IDE) for developing software for the Java platform, the.NET framework, and other environments. So, if you want to run a C program on Linux, then you should install Eclipse on your system.
After the compilation, you need to run the binary file and you will see the output of the program. This is just a brief overview of C Programming, so you need to read more about C Programming.