![]() ![]() ![]() Save the file and compile it into an executable: gcc hello.c -o hello Open your text editorĪnd create the following file: nano hello.c Compiling a Hello World Example #Ĭompiling a basic C or C++ program using GCC is pretty easy. GCC tools and libraries have been installed on your Ubuntu system. Warranty not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This is free software see the source for copying conditions. Ubuntu 20.04 repositories provide GCC version 9.3.0: gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0Ĭopyright (C) 2019 Free Software Foundation, Inc. Verify that the GCC compiler is successfully installed by running the following command that prints the GCC version: gcc -version You may also want to install the manual pages about using GNU/Linux for development: sudo apt-get install manpages-dev The command installs a lot of packages, including gcc, g++ and make. : sudo apt update sudo apt install build-essential To install the Development Tools packages, run the following command as root or user with sudo privileges The default Ubuntu repositories contain a meta-package named “build-essential” that includes the GNU compiler collection, GNU debugger, and other development libraries and tools required for compiling software. This article explains how to install GCC on Ubuntu 20.04. A lot of open-source projects, including the Linux kernel and GNU tools, are compiled using GCC. ![]() The GNU Compiler Collection (GCC) is a collection of compilers and libraries for C, C++, Objective-C, Fortran, Ada, Go ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |