Codeblocks Basic Configuration (under Ubuntu platform)

Source: Internet
Author: User
Tags posix wxwidgets automake

1. Install the compilation environment, C library, C + + library and boost library, as follows:

Sudoapt-get Install Build-essential
* It is possible to install build-essential after GDB has been installed
sudo apt-get installgdb

2. Install the Code::Blocks IDE in Ubuntu Software Center Here's another article from this blog, starting with the source code compilation: Blocks

3. Install the Code::Blocks Debug component Valgrind to detect memory leaks:

sudo apt-get installvalgrind 4. Install the software sudo apt-getinstallcodeblocks-contrib 5, which will be compiled and contributed by the peripheral enthusiasts according to their needs. Install WxWidgets Development Related items: (Note: Pre-installation to www.wxWidgets.org to see the latest version)

sudo apt-get installlibwxbase2.8-dbg sudo apt-get install Libwxbase2.8-dev sudo apt-get install libwxgtk2.8-dbg sudo apt-getinstall libwxgtk2.8-dev sudo apt-get install wx2.8-i18n sudo apt-get install Wx2.8-doc sudo apt-get installwx2.8-examples sudo apt-get install Wx-common started using Code::Blocks, application-and programming->code::blockside.

Code::Blocks and wxwidgets are very well integrated, with almost no additional configuration.

Instructions for use:

1. You can write your own makefile:

Specify the use of custom makefile in the properties of project.  As with VisualStudio, you can define many parameters in the compilation and link process, including defining compilation parameters, which can be found in project's Buildoption or Compiler/debugger settings. For some projects that use Autoconf/automake, I want to create a new project and then import the source code. However, now someone has started to do Autoconf/automake's Codeblocks plugin.

2. You can define shortcut keys:

Unfortunately, you can only define shortcut keys for items that appear in the menu, and you cannot define shortcut keys for items such as ContextMenu in the right-click Popup in Editor.  Settings, Editor, keybordshortcut You can define shortcut keys. Note: [Edit]->[completecode] shortcut key ctrl-space (conflict with Input method) to change to ctrl-k (not limited to ctrl-k, as long as the conflict, the appointment of the key you like).

Management, log, Messagepanel and so on are not autoshow/autohide. Either close, or explicit. Nor can it be docked in a single piece, adsorbed on both sides of the screen. For this problem, I use the method is: To display/hide these pane define shortcut keys, use these shortcut keys to explicitly or hide these pane, the effect is also good.3. Custom F1 Help systemInSettings, Environment->help filesCreate a new entry, named Man, followed by the dialog box select No, and then manually fill in the following path:Man:/usr/share/manTick the default (using the F1 shortcut key). This makes it possible to use the manpage. In the editor, hover the cursor over the content you want to query, press F1, it will pop up a panel, there is the man Manual of query content, very convenient. For example, printf, press F1, and the panel that pops up displays the man manual of printf. Execute the downstream statement under [terminal], install GNU C standard sudo apt-get install Manpages-dev//C API sudo apt-get install manpages-posix//P                Osixfunction sudo apt-get install Manpages-posix-dev//POSIX developdocuments 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: I write this article when Ann 4.1          This man std::string can sudo apt-get install Libstdc++6-4.3-doc//C + + API, it is recommended to first this test, and then try 4.1 sudo apt-get install Manpages-zh Chinese document modification Man's default language sudo gedit/etc/manpath.config put all the inside/usr/share/manLine copy to its next line and change to/USR/SHARE/MAN/ZH_CNChinese on, English in the following, as follows: (note: The beginning of the Mandb_map do not change, or there will be the following error prompt
Man: Unable to parse/usr/share/man/zh_cn/man3/std::vector.3.gz: no file or directory) Mandatory_manpath/usr/share/man/zh_cnmanpath_map/ Bin/usr/share/man/zh_cnmanpath_map/bin/usr/share/manmanpath_map/usr/bin/usr/share/man/zh_cnmanpath_map/usr/bin /usr/share/manmanpath_map/sbin/usr/share/man/zh_cnmanpath_map/sbin/usr/share/manmanpath_map/usr/sbin/usr/share /man/zh_cnmanpath_map/usr/sbin/usr/share/manmanpath_map/usr/games/usr/share/man/zh_cnmanpath_map/usr/games/usr /share/man exit after saving

4. Auto-complete function settings each new project will be added to the directory where the header file is located in the menu [Project]->[properties ...., so that auto-completion and informational prompting function will work properly. The following is a directory of standard library header files:/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 this is the file path of the socket/usr/include/sys/usr/ Include/netinet/usr/include/arpa is not immediately effective, after a period of time you will find the function suddenly appear!

5. Modify the GNU ARM GCC Compiler1. [Settings], [Compiler and Debuggersettings] modifies setectedcompiler to the GNU ARM GCC compiler. 2. On the [Toolchain Executables] tab of the same page, select [Program Files] Options page, 1) First modify compiler ' s installation directory for your arm GCC compiler installation Address: 2) Select replace C compiler (ARRM-LINUX-GCC), C + + compiler (arm-linux-g++), Dynamic Library Linker (arm-linux-g++), Static Library linker (Arm-linux-ar), debugger (AR M-LINUX-GDB);

Note: The Make program also uses/usr/bin/make, that is, the GNU GCC comes with!

6. Intelligent configuration: One, [Settings], [Editor ...], "Code-completion and Symbols Browser" in 1. The Keyword sets to additionally include in 1 to 9 are ticked, 1 ~ 9 corresponding keywords can be in the "Syntax highlighting" [keywords ...] button, the default 1 is the C + + keyword, 3 is the Doxygen keyword, and 2. Put Delay for auto-kick-in when typing [.::->] pull to 200ms, so hurry up and cue 3. Change the automatically launch when typed # letters 4 to 2, so two letters will be prompted 4. Remove the case-sensitive match tick and it will help you correct the case

A number of abbreviations (also customizable) are defined in [Editor ...], [Settings], as long as you enter these abbreviations and press CTRL+J, you can automatically complete the common code framework. And the cursor can be placed in the appropriate place (in the custom use | expression), commonly used are: Guard, class, switch and so on.

7. Shortcut keys: Ctrl + scroll           code fonts will grow as you please. Right + drag mouse     Save to pull (especially horizontal) scrollbars, related settings: Mouse Drag Scrollingatl + drag mouse       implement partial selection (only characters within the range are selected, not the other characters of the row they are in). ctrl+d                to copy the current row or check the block Ctrl + drag mouse     copy to new position ctrl+shift+c       comment out the current line or select Block ctrl+shift+x        Dismiss Annotations tab                       indent Current line or select Block Shift +tab           Reduced indent f2                         hidden below logs & others bar shift+f2               Left management bar ctrl+g                   arrive at the designated line alt+g                  reach the specified file ctrl+alt+g             arrives at the specified function (the function definition in the header file is supported) f11                        Toggle source file and header file Ctrl +pageup         reached the last function, Ctrl +pagedown  , to reach the next function. Ctrl +b                  Add bookmarks alt +pageup and ALT +pagedown    you can toggle the bookmark Ctrl +shift +b      to find the matching parentheses. 8. Back up the ~/codeblocks/default.conf, you will not lose your configuration. Executing the cb_share_config command in the terminal will open the following window to back up:

on the *********************************************************************************************** of the red super-mind After completing the above steps, you need to add a few instructions, if the installation method according to my previous source code to install the way, the configuration file path is located in ~/.codeblocks/ Default.conf I habitually use these good and common tool configurations as a git project to save on GitHub.

Codeblocks Basic Configuration (under Ubuntu platform)

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.