mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
translated
This commit is contained in:
parent
4660f83a19
commit
582a02f58c
@ -1,103 +0,0 @@
|
||||
[#]: subject: (How to Install Code Blocks IDE on Ubuntu Linux)
|
||||
[#]: via: (https://itsfoss.com/install-code-blocks-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
How to Install Code Blocks IDE on Ubuntu Linux
|
||||
======
|
||||
|
||||
Code Blocks is an open source IDE written in C++ and ideal for C, C++ and Fortran development. It is cross-platform and runs on Linux, macOS and Windows.
|
||||
|
||||
Code Blocks is lightweight and fast. It supports workspaces, multi-target projects, inter project dependencies inside workspace.
|
||||
|
||||
You get syntax highlighting, code folding, tabbed interface, class browser, smart indentation and more. You can also extend the feature of the IDE via plugins.
|
||||
|
||||
In this tutorial, you’ll learn to install Code Blocks on Ubuntu-based Linux distributions.
|
||||
|
||||
Note
|
||||
|
||||
Code Blocks is also available in Ubuntu Software Center. However, as of Ubuntu 21.04, installing Code Blocks graphically from the Ubuntu Software Center installs a codeblocks-common package, not the graphical IDE. And thus you don’t see the Code Blocks installed on your system to run. For this reason, I recommend taking the terminal approach for installing Code Blocks on Ubuntu.
|
||||
|
||||
### Install Code Blocks on Ubuntu-based Linux distributions
|
||||
|
||||
The [Code Blocks IDE][1] is available in the universe repository of all Ubuntu releases. Though it is usually enabled by default, it won’t harm to [enable universe repository][2] first:
|
||||
|
||||
```
|
||||
sudo add-apt-repository universe
|
||||
```
|
||||
|
||||
Update the package cache so that system knows about the availability of the additional packages from the newly added repository:
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
And finally, you can install Code Blocks on Ubuntu-based distributions using the apt install command:
|
||||
|
||||
```
|
||||
sudo apt install codeblocks
|
||||
```
|
||||
|
||||
![][3]
|
||||
|
||||
It is advised to also install additional plugins to get more out of the Code Blocks IDE. You can install them using the codeblocks-contrib package:
|
||||
|
||||
```
|
||||
sudo apt install codeblocks-contrib
|
||||
```
|
||||
|
||||
### How to use Code Blocks
|
||||
|
||||
Search for Code Blocks in the system menu. This is what it looks like in Ubuntu’s default GNOME version:
|
||||
|
||||
![][4]
|
||||
|
||||
When you first start Code Blocks, it looks for all the available compilers on your system and adds it to the path so you don’t have to configure it on your own.
|
||||
|
||||
In my case, I already had gcc installed on my Ubuntu system and it was well recognized by Code Blocks.
|
||||
|
||||
![][5]
|
||||
|
||||
The user interface of Code Blocks is definitely not modern but keep in mind that the IDE is lightweight and it hardly consumes 50 MB of RAM.
|
||||
|
||||
If you have ever used another IDE like Eclipse, you won’t find it difficult to use Code Block. You can write your code and organize them in projects.
|
||||
|
||||
The buttons to build, run and build and run together is right their on the top.
|
||||
|
||||
![][6]
|
||||
|
||||
When you run the code, it opens a new terminal window to display the output.
|
||||
|
||||
![][7]
|
||||
|
||||
That’s the bare minimum information you need about Code Blocks. I leave it up to you to explore it further by going through its [wiki][8] and [user manual][9].
|
||||
|
||||
Having an IDE makes [running C or C++ programs on Linux][10] easier. Eclipse is a good IDE for that job but it consumes more system resources than Code Blocks. Of course, in the end, it’s your choice that matters.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-code-blocks-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.codeblocks.org/
|
||||
[2]: https://itsfoss.com/ubuntu-repositories/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-code-blocks-ubuntu.png?resize=800%2C445&ssl=1
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ubuntu.jpg?resize=800%2C231&ssl=1
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/code-blocks-ide-first-run.png?resize=800%2C529&ssl=1
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ide.png?resize=800%2C543&ssl=1
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-code-run-terminal.png?resize=504%2C371&ssl=1
|
||||
[8]: https://wiki.codeblocks.org/index.php/Main_Page
|
||||
[9]: https://www.codeblocks.org/user-manual/
|
||||
[10]: https://itsfoss.com/c-plus-plus-ubuntu/
|
@ -0,0 +1,103 @@
|
||||
[#]: subject: (How to Install Code Blocks IDE on Ubuntu Linux)
|
||||
[#]: via: (https://itsfoss.com/install-code-blocks-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
如何在 Ubuntu Linux 上安装 Code Blocks IDE
|
||||
======
|
||||
|
||||
Code Blocks 是一个用 C++ 编写的开源 IDE,非常适合 C、C++ 和 Fortran 开发。它是跨平台的,可以在 Linux、macOS 和 Windows 上运行。
|
||||
|
||||
Code Blocks 是轻量级和快速的。它支持工作区、多目标项目、工作区内的项目间依赖关系。
|
||||
|
||||
你可以得到语法高亮,代码折叠,标签式界面,类浏览器,智能缩进等。你还可以通过插件扩展 IDE 的功能。
|
||||
|
||||
在本教程中,你将学习如何在基于 Ubuntu 的 Linux 发行版上安装 Code Blocks。
|
||||
|
||||
注意
|
||||
|
||||
Code Blocks 也可以在 Ubuntu 软件中心找到。然而,从 Ubuntu 21.04 开始,从 Ubuntu 软件中心以图形方式安装 Code Blocks 会安装一个 codeblocks-common 软件包,而不是图形化 IDE。因而你看不到安装在你系统上的 Code Blocks 的运行。由于这个原因,我建议采取终端的方式在 Ubuntu 上安装 Code Blocks。
|
||||
|
||||
### 在基于 Ubuntu 的 Linux 发行版上安装 Code Blocks
|
||||
|
||||
[Code Blocks IDE][1] 在所有 Ubuntu 版本的 universe 库中都有。虽然它通常是默认启用的,但先[启用 universe 仓库][2]也无妨:
|
||||
|
||||
```
|
||||
sudo add-apt-repository universe
|
||||
```
|
||||
|
||||
更新软件包缓存,这样系统就能知道新添加的仓库中的额外软件包的可用性:
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
最后,你可以使用 apt install 命令在基于 Ubuntu 的发行版上安装 Code Blocks:
|
||||
|
||||
```
|
||||
sudo apt install codeblocks
|
||||
```
|
||||
|
||||
![][3]
|
||||
|
||||
建议你也安装额外的插件,以便从 Code Blocks IDE 中获得更多。你可以使用 codeblocks-contrib 包来安装它们:
|
||||
|
||||
```
|
||||
sudo apt install codeblocks-contrib
|
||||
```
|
||||
|
||||
### 如何使用 Code Blocks
|
||||
|
||||
在系统菜单中搜索 Code Blocks。这是在 Ubuntu 默认的 GNOME 版本中的样子:
|
||||
|
||||
![][4]
|
||||
|
||||
当你第一次启动 Code Blocks 时,它会寻找你系统中所有可用的编译器,并将其添加到路径中,这样你就不用自己去配置它了。
|
||||
|
||||
在我的例子中,我的 Ubuntu 系统上已经安装了 gcc,Code Blocks很 好地识别了它。
|
||||
|
||||
![][5]
|
||||
|
||||
Code Blocks 的用户界面绝对不现代,但请记住,这个 IDE 是轻量级的,它几乎消耗不到 50MB 的内存。
|
||||
|
||||
如果你曾经使用过像 Eclipse 这样的其他 IDE,你就不会觉得使用 Code Block 有什么困难。你可以写你的代码并把它们组织在项目中。
|
||||
|
||||
构建、运行并构建和运行按钮一起在顶部。
|
||||
|
||||
![][6]
|
||||
|
||||
当你运行代码时,它会打开一个新的终端窗口来显示输出。
|
||||
|
||||
![][7]
|
||||
|
||||
这就是你需要的关于 Code Blocks 的最少信息。我把它留给你,让你通过浏览它的 [wiki][8] 和[用户手册][9]来进一步探索它。
|
||||
|
||||
拥有一个 IDE 可以使[在 Linux 上运行 C 或 C++ 程序][10]更容易。Eclipse 是一个很好的 IDE,但它比 Code Blocks 要消耗更多的系统资源。当然,最后,重要的是你的选择。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-code-blocks-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.codeblocks.org/
|
||||
[2]: https://itsfoss.com/ubuntu-repositories/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/install-code-blocks-ubuntu.png?resize=800%2C445&ssl=1
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ubuntu.jpg?resize=800%2C231&ssl=1
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/code-blocks-ide-first-run.png?resize=800%2C529&ssl=1
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-ide.png?resize=800%2C543&ssl=1
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/code-blocks-code-run-terminal.png?resize=504%2C371&ssl=1
|
||||
[8]: https://wiki.codeblocks.org/index.php/Main_Page
|
||||
[9]: https://www.codeblocks.org/user-manual/
|
||||
[10]: https://itsfoss.com/c-plus-plus-ubuntu/
|
Loading…
Reference in New Issue
Block a user