Homepage › Forums › Articles › Programming › C, C++, and C# › Preparation for Programming in Linux
This topic was published by Hooman Aminvand and viewed 1842 times since "". The last page revision was "".
- AuthorPosts
In this session, we will familiarize ourselves with the installation requirements and see what tools are needed for programming in C.
Basic Concepts
Compiler: Tool or software that converts programming codes (C/C++, Java, etc.) to machine code (computers understanding machine code)
Important Outputs
- Error Codes: If there is a mistake in your code, error codes will show your mistakes
- Precautions: In some cases, such as when the code contains a useless variable that is not used in the program, an alert is generated. Warnings, unlike errors, do not prevent the implementation of the program, and warnings are merely notifications to optimize the program.
- Executable File: A file that has the ability to execute.
For this tutorial, we will use Ubuntu. You will be able to work with Linux and learn basic information about commands. You will learn about C-programming and the GCC compiler.
Installation
First, you need a GNU/Linux operating-system with BASH, such as Ubuntu. We will see if the GCC compiler is installed using a terminal (Ctrl+Alt+T). Type "gcc" and then double-press Tab.
If it shows you that it is not installed on your system, you will enter
sudo apt-get install gcc
.GCC has C libraries, but to be able to compile C++, you will enter
sudo apt-get install build-essential
.Next, type "g++" and double-press Tab and you should see a list of "g++" commands.
Now, your compiler is ready!
Further Reading
- Writing Your First C Program in Linux - https://dcjtech.info/topic/writing-your-first-c-program-in-linux/
- A Newbie's Guide to the Linux System (Article Index) - https://dcjtech.info/topic/a-newbies-guide-to-the-linux-system/
- Programming and Development (Article Index) - https://dcjtech.info/topic/programming-and-development/
- Linux Compilers - https://dcjtech.info/topic/linux-compilers/
- AuthorPosts