How Do I Install Code Blocks in Ubuntu?
Contents

Code::Blocks IDE is available on Ubuntu repositories and can be installed with the APT command. Installation from the default repository is the simplest method, But it may have bit older versions.

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. However, Ubuntu repository only contains the outdated version (Code Blocks 16.01). To install the latest version, download the latest version. Extract the tarball.

Does Ubuntu have C++ compiler?

Ubuntu provides the standard Gnu Compiler Collection in the repositories. (which includes the standard C++ libraries). . It’s a full-fledged IDE with a visual form designer, code-editor, and debugger.

To run the current project, choose Build→Run from the menu. You see the terminal window appear, listing the program’s output, plus some superfluous text. Press the Enter key to close the command prompt window. And now, for the shortcut: You can build and run a project using a single command: Choose Build→Build and Run.

To open a project From the File menu select Open. From the Files of type: in the window, select “Code::Blocks project files” and then select the . cbp file pertaining to your program. Press Open when done.

Press Ctrl-F9, Build->Build, or Compiler Toolbar->Build (button – the gear) to compile the project. If the following output is generated in the build log (in the bottom panel) then all steps were followed correctly. The executable may now be run by either clicking the Run button or hitting Ctrl-F10.

With code::blocks you can set your command line arguments like this in the menu: Project > Set programs’ arguments… This opens a window where you can insert your parameters. You need create a project before your code if you want you can click Project -> Set Program Arguments.

Open Code Blocks -> Settings -> Editor -> on the left click Default code -> write your template -> you have your default code ready to be used …

Install CodeBlocks on Linux/Ubuntu

  1. sudo add-apt-repository ppa:damien-moore/codeblocks-stable.
  2. sudo apt update.
  3. sudo apt install codeblocks codeblocks-contrib.

Now update the packages by using the following command

[email protected]:~# apt update Get:1 focal InRelease [17.5 kB] Hit:2 focal InRelease Hit:3 focal InRelease . . .

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest