tutorial: https://www3.ntu.edu.sg/home/ehchua/programming/howto/CodeBlocks_HowTo.html
This tutorial will be showing you how to install Code Blocks on Ubuntu 16.04/Ubuntu 18.04, 19.04. Code Blocks is a free, open-source integrated development environment (IDE) for C, C++ and Fortran. It can run on Linux, Mac, Windows. The latest version, Code Blocks 17.12, was released on December, 2017.
Code Blocks features:
- Supports multiple compilers including GCC, Clang, Visual C++, MinGW and many more
- Custom build system and optional Make support.
- Syntax highlighting and code folding
- C++ code completion, class browser, a hex editor
- A debugger with full breakpoint support
- A plug-in system to support other programming languages.
- And more
How to Install Code Blocks IDE on Ubuntu 16.04/Ubuntu 18.04, 19.04
Code Blocks is in the default Ubuntu package repository, so you can open up a terminal window and run the following command to install it.sudo apt install codeblocksHowever, Ubuntu repository only contains the outdated version (Code Blocks 16.01). To install the latest version, download the latest version.
64 bit
wget http://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Linux/Debian%20stable/codeblocks_17.12-1_amd64_stable.tar.xz32 bit
wget http://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Linux/Debian%20stable/codeblocks_17.12-1_i386_stable.tar.xzExtract the tarball.
64 bit
sudo tar xvf codeblocks_17.12-1_amd64_stable.tar.xz32 bit
sudo tar xvf codeblocks_17.12-1_i386_stable.tar.xzNow in the current directory, there are many Code Blocks deb packages. We need to run the following command to install Code Blocks.
64 bit
sudo apt install ./codeblocks_17.12-1_amd64.deb ./codeblocks-common_17.12-1_all.deb ./libcodeblocks0_17.12-1_amd64.deb ./codeblocks-dev_17.12-1_amd64.deb ./codeblocks-headers_17.12-1_all.deb ./*wx*.deb32 bit
sudo apt install ./codeblocks_17.12-1_i386.deb ./codeblocks-common_17.12-1_all.deb ./libcodeblocks0_17.12-1_i386.deb ./codeblocks-dev_17.12-1_i386.deb ./codeblocks-headers_17.12-1_all.deb ./*wx*.debOnce installed, you can start Code Blocks IDE from Unity Dash or your preferred app launcher.
Choosing a C Compiler
Upon first launch of Code Blocks, you will be prompted with a Compilers auto-detection window:Tow popular open-source C compilers available for Linux are:
- GNU C Compiler – the defacto-standard open-source C compiler
- Clang – Clang is much faster and uses far less memory than GCC and it provides extremely clear and concise diagnostics (error and warning messages).
sudo apt install gccTo install the Clang compiler:
sudo apt install clangIf you want to compile native Windows binaries on Linux, then you can install the
mingw-w64
package.sudo apt install mingw-w64After choosing your default C compiler, you can start using Code Blocks to write programs.
You can also choose your default compiler by going to Settings > Compiler > Global Compiler Settings.
That’s it! I hope this tutorial helped you install Code Blocks on Ubuntu 16.04/Ubuntu 18.04, 19.04.
No comments:
Post a Comment