How to install codeblocks13 in Ubuntu

Source: Internet
Author: User
Tags function definition posix valgrind wxwidgets automake

It is difficult to install codeblocks in linux. Generally, the installation of CB fails due to the installation failure of various dependencies to be installed, then there will be various conflicts during the installation of various dependencies, and a lot of errors will be reported, which will be more troublesome. On the Internet, various installation failure messages are piled up.

In this regard, Intellij Idea is much better. A compressed package is directly provided, and the package can be decompressed and executed. The difference is not half past one.

I installed the latest codeblocks13 version under Ubuntu14.04. After several tests, I finally succeeded. The installation steps are as follows.

First, the figure above indicates that the installation is complete.


Source file to be downloaded

My computer is a 64-bit host and uses Ubuntu14.04. Therefore, we need to install 64-bit CB. Download the source files from the CB official website here: Click to download.

Install dependent software packages

The following actions are performed in order: because I have not tried to reverse their order, if you do not install them in order, you are not sure if they will conflict.

1. sudo apt-get install build-essential

2. sudo apt-get install libwxgtk2.8-0 libwxgtk2.8-dev wx2.8-headers wx-common

3. sudo apt-get install libgamin0

4. sudo apt-get install libwxgtk2.8-0

5. I also installed libc6, but I feel that it has nothing to do with the installation of CB.

6. Decompress the downloaded codeblocks13.12-1_amd64.debian.stable.tar.gz to any folder, and then switch to the folder.

7. sudo apt-get update. This is for fear that the software package version is not new.

8. sudo dpkg-I libcodeblocks0_13.12-1_amd64.deb

9. sudo dpkg-I libwxsmithlib0_13.12-1_amd64.deb

10. sudo dpkg-I *. deb

After step 10, start to install CB. Check whether any errors are reported during the installation process (which should be absent). If yes, check whether any dependency is missing, package the corresponding software.

After the installation is complete, enter codeblocks under Terminal to use codeblocks.

Finally, after entering codeblocks, the CB runs :)


Install and use Code: Blocks in Ubuntu

To install Code: Blocks in Ubuntu, follow these steps:

Installation steps:

1. Install the compiling environment, C Library, C ++ library, and Boost library as follows:

Sudo apt-get install build-essential

* It is possible that gdb has been installed after build-essential is installed.

Sudo apt-get install gdb

2. Install Code: Blocks IDE in the Ubuntu Software Center


3. Install the Debug Component Valgrind of Code: Blocks to detect memory leakage:

Sudo apt-get install valgrind

4. Install software compiled and contributed by peripheral enthusiasts as needed

Sudo apt-get install codeblocks-contrib

5. Install wxWidgets development items: (Note: Check the latest version on www.wxWidgets.org before installation)

Sudo apt-get install libwxbase2.8-dbg

Sudo apt-get install libwxbase2.8-dev

Sudo apt-get install libwxgtk2.8-dbg

Sudo apt-get install libwxgtk2.8-dev

Sudo apt-get install wx2.8-i18n

Sudo apt-get install wx2.8-doc

Sudo apt-get install wx2.8-examples

Sudo apt-get install wx-common

Start using Code: Blocks, application-> programming-> Code: Blocks IDE.

Code: Blocks and wxWidgets are well integrated and almost no additional configuration is required.

Instructions for use:

1. You can write Makefile yourself:

Specify custom makefile in the Project attributes. Like visual studio, you can define many parameters in the compilation and link processes, including the compilation parameters, which can be found in build option or compiler/debugger settings of the Project.

For some projects that use autoconf/automake, I want to create a new project and then import the source code. However, someone has started to do the autoconf/automake code blocks plugplugin.

2. You can define the shortcut key:

Unfortunately, you can only define shortcut keys for projects that appear in the menu. For example, the shortcut keys cannot be defined for projects in context menu that are right-clicked in the editor.

The shortcut keys can be defined in Settings-> Editor-> Keybord shortcut cut.

Note: the [Edit]-> [Complete code] shortcut key Ctrl-Space (conflicts with the input method) should be changed to Ctrl-k

(Not limited to Ctrl-k, as long as there is no conflict, use your favorite key ).

Management, log, message panel, etc. cannot be autoshow/autohide. Either close or explicitly. It cannot be a single dock and adsorbed on both sides of the screen. To solve this problem, I used: define shortcuts for the pane display/hide, and use these shortcuts to explicitly or hide these pane.

3. Customized F1 help system

In Settings-> Environment-> Help files, create an entry named man. In the next dialog box, select no, and manually enter man:/usr/share/man in the path below.

Hook default (using the F1 shortcut. In this way, you can use manpage. In the editor, place the cursor over the content you want to query. Press F1 and a panel will pop up. There is a man manual for the query content, which is very convenient. For example, in printf, press F1, and the printf man manual is displayed in the pop-up panel.

Run the following statements on the [terminal] to install the gnu c standard.

Sudo apt-get install manpages-dev // C API

Sudo apt-get install manpages-posix // posix function

Sudo apt-get install manpages-posix-dev // posix develop documents

Sudo apt-get install glibc-doc // C API

Sudo apt-get install stl-manual // STL

Sudo apt-get install libstdc ++ 6-4.1-doc // Note: When I write this article, the man std: string can

Sudo apt-get install libstdc ++ 6-4.3-doc // C ++ API. We recommend that you install this first and try again 4.1.

Sudo apt-get install manpages-zh // Chinese document

Modify man's default language

Sudo gedit/etc/manpath. config

Copy all rows containing/usr/share/man to the next row and change it to/usr/share/man/zh_CN.

The English is as follows:

(Note: do not change the name starting with MANDB_MAP. Otherwise, the following error message will be displayed:

Man: unable to parse/usr/share/man/zh_CN/man3/std: vector.3.gz: No such file or directory)

MANDATORY_MANPATH/usr/share/man/zh_CN

MANPATH_MAP/bin/usr/share/man/zh_CN

MANPATH_MAP/bin/usr/share/man

MANPATH_MAP/usr/bin/usr/share/man/zh_CN

MANPATH_MAP/usr/bin/usr/share/man

MANPATH_MAP/sbin/usr/share/man/zh_CN

MANPATH_MAP/sbin/usr/share/man

MANPATH_MAP/usr/sbin/usr/share/man/zh_CN

MANPATH_MAP/usr/sbin/usr/share/man

MANPATH_MAP/usr/games/usr/share/man/zh_CN

MANPATH_MAP/usr/games/usr/share/man

Save and exit

4. Auto-complete full-function settings

For each new Project, choose [Project]> [Properties...] from the menu. -> [C/C ++ parser options] add the directory where the header file is located, so that the automatic completion and information prompting function can work properly. The following is the Directory of the standard library header file:

/Usr/include

/Usr/include/bits

/Usr/include/c ++/4.3/tr1

/Usr/local/include

/Usr/lib/gcc/i486-linux-gnu/4.3/include

/Usr/lib/gcc/i486-linux-gnu/4.3.3/include

Below is the socket file path

/Usr/include/sys

/Usr/include/netinet

/Usr/include/arpa

The function does not take effect immediately after it is added. After a while, you will find that the function suddenly appears!

5. Modify gnu arm gcc Compiler

1. [Settings]-> [Compiler and debugger settings]

Change Setected compiler to the gnu arm gcc compiler.


2. On the same page, select the [program files] option page on the [Toolchain executables] tab,

1) first modify Compiler's installation directory to your arm gcc Compiler installation address;

2) replace the C compiler (arrm-linux-gcc), C ++ compiler (arm-linux-g ++ ),

Dynamic library linker (arm-linux-g ++), static library linker (arm-linux-ar ),

Debugger (arm-linux-gdb );

Note: The make program also uses/usr/bin/make, which is included in gnu gcc!


6. Intelligent configuration:

1. [Settings]-> [Editor...]-> "Code-completion and symbols browser"

1. Hook 1 to 9 in Keyword sets to additionally include,

1 ~ 9. You can set the corresponding keyword in the [keywords...] button of "Syntax highlighting,

By default, 1 is the C ++ keyword, and 3 is the Doxygen keyword;

2. Pull Delay for auto-kick-in when typing [.:->] to 200 ms, so that a prompt is displayed.

3. Change 4 in Automatically launch when typed # letters to 2, so that two letters will prompt you.

4. Remove the Case-sensitive match check, which will help you correct the Case

2. [Settings]-> [Editor...]-> "Abbreviation"

Many abbreviations are defined (and can be customized). You only need to enter these abbreviations and press Ctrl + J to automatically complete common code frameworks, you can also place the cursor in a proper place (used for custom expressions |), which are commonly used, such as guard, class, and switch.

7. Shortcut keys:

Ctrl + scroll wheel code font will increase as you wish

Right-click the scroll bar and Drag the Mouse to save the scroll bar (especially horizontal). Settings: Mouse Drag Scrolling

Atl + drag the mouse to achieve partial selection (only the characters in the selected area are selected, but not other characters in the row where they are located ).

Ctrl + D to copy the current row or selected block

Ctrl + drag the mouse to the new location

Ctrl + Shift + C comment out the current row or selected block

Ctrl + Shift + X uncomment

Tab indent the current row or selected block

Shift + Tab reduce indentation

Logs & others column under F2 explicit hidden

Shift + F2 hide left Management column

Ctrl + G to reach the specified row

ALT + G to reach the specified file

Ctrl + Alt + G to reach the specified function (function definition in the header file is supported)

F11 switch source file and header file

Ctrl + PageUp to the previous function

Ctrl + PageDown to the next function.

Ctrl + B add bookmarks

Alt + PageUp and

Alt + PageDown can switch bookmarks

Ctrl + Shift + B to find matching parentheses.

8. Backup ~ /Codeblocks/Default. conf will not lose your configuration.

Run the cb_cmd_config command on the terminal. The following window is opened for backup:



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.