Codeblocks and codelite are available on the software centre of ubuntu and Dev can be installed by installing Wine first from the software centre and then you can use the.exe setup which is used in windows. These are my personal favourites. There are many more. EDIT: If you want to use C. May 18, 2016 g is a program that calls GCC and automatically specifies linking against the C library. It treats '.c ', '.h ' and '.i ' files as C source files instead of C source files unless -x is used.
How do I install gnu gcc compiler and related tools such as autoconf, automake, flex, c++ compiler, and bison on a CentOS 7 or Red Hat Enterprise Linux version 7 server? How can I install GCC (C and C++ Compiler) and development tools on a CentOS or RHEL 7?
You can setup a basic development environment with the following packages on a CentOS Enterprise Linux or Red Hat Enterprise Linux version 7:
Animated gif 01: Installing C & C++ and related packages on a CentOS and RHEL 7
You need to install following packages on Debian and Ubuntu Linux:
build-essential package – Installs the following collection to compile c/c++ program on a Ubuntu Linux including:
You can setup a basic development environment with the following packages on a CentOS Enterprise Linux or Red Hat Enterprise Linux version 7:
Advertisements
CentOS / RHEL 7: Install GCC Package list
- autoconf
- automake
- binutils
- bison
- flex
- gcc (c compiler)
- gcc-c++ (c++ compiler)
- gettext
- libtool
- make
- patch
- pkgconfig
- redhat-rpm-config
- rpm-build
- rpm-sign
Installing GCC c and c++
Open the Terminal app and type the following commands.
Command to list groups on a CentOS / RHEL 7
Type the following yum command:
Sample outputs:
Another option:
Sample outputs:
# yum group list
Sample outputs:
Another option:
# yum group list ids
Sample outputs:
Command to install GCC and Development Tools on a CentOS / RHEL 7 server
Type the following yum command as root user:
OR
If above command failed, try:
Sample outputs:
# yum group install 'Development Tools'
OR
$ sudo yum group install 'Development Tools'
If above command failed, try:
# yum groupinstall 'Development Tools'
Sample outputs:
A note about failing groupinstall on CentOS/RHEL 7.x
To install all the packages belonging to a package group called “Development Tools” use the following command:
OR
The yum has changed in Red Hat Enterprise Linux 7/CentOS 7. The package group “Development Tools”” has only the optional packages which by default doesn’t get installed. So we will need to pass the option --setopt=group_package_types=mandatory,default,optional to install the optional packages too.
# yum --setopt=group_package_types=mandatory,default,optional groupinstall 'Development Tools'
OR
# yum --setopt=group_package_types=mandatory,default,optional group install 'Development Tools'
The yum has changed in Red Hat Enterprise Linux 7/CentOS 7. The package group “Development Tools”” has only the optional packages which by default doesn’t get installed. So we will need to pass the option --setopt=group_package_types=mandatory,default,optional to install the optional packages too.
Verify your gcc installation on a CentOS / RHEL 7 server
Type the following command to see gcc location:
Type the following command to see gcc compiler version:
Test gcc C compiler with a sample foo.c program
Create a file called foo.c as follows:
To compile foo.c into foo executable file, type:
To execute foo program, type:
$ cc foo.c -o foo
To execute foo program, type:
A note about install man pages on a CentOS 6/7
Use the yum command as follows:
$ ## [ CentOS 7 ] ##
$ sudo yum install man-pages man-db man
$ ## [ CentOS 6.x ] ##
$ sudo yum install man man-pages
Conclusion
You learned how to install GNU c, c++ compilers and releated tools on a CentOS or Red Hat Enterprise Linux version 7.x. See GCC site for more info.
This entry is 3 of
Dev C++ Download And Install
13 in the Linux GNU/GCC Compilers Tutorial series. Keep reading the rest of the series:- CentOS / RHEL 7: Install GCC (C and C++ Compiler) and Development Tools
ADVERTISEMENTS
How do I install GNU/GCC (C and C++) compiler and related tools (such as make, debugger, man pages) collection under Ubuntu Linux operating system using command line options?You need to install following packages on Debian and Ubuntu Linux:
![Install Dev C++ For Linux Install Dev C++ For Linux](/uploads/1/2/6/1/126183708/951743703.jpg)
build-essential package – Installs the following collection to compile c/c++ program on a Ubuntu Linux including:
Advertisements
- libc6-dev – C standard library.
- gcc – C compiler.
- g++ – C++ compiler.
- make – GNU make utility to maintain groups of programs.
- dpkg-dev – Debian package development tools.
Basically, build-essential package contains an informational list of packages which are considered essential for building Ubuntu packages including gcc compiler, make and other required tools. This package also depends on the packages on that list, to make it easy to have the build-essential packages installed. In this tutorial, you will learn about installing the GNU C compiler and GNU C++ compiler on a Ubuntu Linux.
Installing compilers using apt command
Open the terminal app and type the following apt command/apt-get command:
OR
Sample outputs:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install build-essential
OR
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
Sample outputs:
Verify installation
Type the following commands:
$ whereis gcc make
$ gcc --version
$ make -v
Installing the dev man pages on a Ubuntu Linux
Type the following command:
To view library calls (functions within program libraries), enter:
You can write a small program to test GNU c/c++ compiler:
Append the following code:
$ sudo apt-get install manpages-dev man-db manpages-posix-dev
To view library calls (functions within program libraries), enter:
$ man 3 scanf
$ man 2 execve
$ man 2 fork
You can write a small program to test GNU c/c++ compiler:
$ vi test.cpp
Append the following code:
Save and close the program. You can compile it as follows:
OR
You should get an executable named test in the current directory:
Sample outputs:
$ make test
OR
$ g++ test.cpp -o test
You should get an executable named test in the current directory:
$ ls -l test
Sample outputs:
Just run it:
$ ./test
Installing the X11 development compilers
Type the following command:
This entry is 1 of 13 in the Linux GNU/GCC Compilers Tutorial series. Keep reading the rest of the series:
$ sudo apt install libx11-dev
- Ubuntu Linux Install GNU GCC Compiler and Development Environment
How To Install Dev C++ For Linux
ADVERTISEMENTS