Linux under the source installation Codeblocks

Source: Internet
Author: User
Tags directory create gtk

Linux under source installation codeblocks Qianghaohao (codingnutter)

A. Installation Platform Description:

centos6.4-i686 gcc-4.4.7

Two. Download the latest source code:

Http://www.codeblocks.org/downloads

The latest version is installed here: code::blocks 16.01

Three. Read the official Installation instructions document:

Http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux

The following information can be obtained by reading the official installation documentation:

installation Codeblocks The following dependencies are available:

Code::blocks-> Xwwidget (> libwxGTK2.8), GTK + (> libgtk-x11-2.0)->x

        That means installing it first .Xsystem, which is the desktop bar, then installlibgtk-x11-2.0, and then installlibwxGTK2.8, and finally start the source installationCode::Blocks.

Four Follow the dependencies above to start the installation in turn:

1. Create a directory:

mkdir ~/devel      //home directory Create devel directory, this directory name can be arbitrarily specified

2. Install the GTK + (libgtk-x11-20) Library:

Yum Install gtk+*

3. Source Installation WXGTK (libwxGTK2.8) library :

Download WXGTK Source:

https://sourceforge.net/projects/wxwindows/files/2.8.7/

Please choose the following source package, do not choose the wrong:

Copy the downloaded source to the directory you created earlier : ~/devel/ , then unzip:

1 mv./desktop/wxgtk-2.8.12.tar.gz devel/    //Copy the Desktop WXGTK source package to the previously established working directory Devel2 CD devel/    //Enter Devel directory 3 tar zxvf wxgtk-2.8.12.tar.gz     //Decompression Source Package

Enter wxGTK-2.8.12 The directory executes the following command:

mkdir Build_gtk2_shared_monolithic_unicode  //Build compilation directory CD Build_gtk2_shared_monolithic_unicode     //Enter the newly created directory. /configure--prefix=/opt/wx/2.8--enable-xrc--enable-monolithic--enable-unicode   //Execute Configure script file   make Start compiling SU  //switch to Rootmake install   //Start Installation  

The installation process is as follows:

Follow the steps above to see Makefile has been generated and can now be Make compiled by:

Make   //start compiling

Compile to finish, start installing make install:

SU root   //switch to root user make install    //Start Installation

The following information appears to indicate that the WXGTK library installation is complete:

4. All the above preparations have been completed, and now the installation of code::blocks:

Also first copy the CB source code to our previously created working directory: ~/devel, and then into the source directory:

Mv.. /desktop/codeblocks-16.01.release/./     //Copy the Codeblocks source package to the current directory (devel/) CD codeblocks.16.01.release/    // Enter the source directory

will be wxGTK-2.8.12 under the WXWIN.M4 copied to /usr/share/aclocal:

CP wxwin.m4/usr/share/aclocal     //Copy wxwin.m4 under wxGTK-2.8.12 to/usr/share/aclocal

Enter Codeblocks source directory, execution ./bootstrap :

./bootstrap

Start Execution Configure Script:

./configure–with-wx-config=/opt/wx/2.8/bin/wx-config

To start compiling: Make

Make   //start compiling

Switch to Root Installation:

SU root   //switch to root user make install    //Start Installation

you can now see Codeblocks The installation is complete:

Five. start codeblocks:

1. start with the command line:

all of the above steps Codeblocks installed in the Linux system, but the problem arises when we start directly:

The reason is that I can't find libwx_gtk2u-2.8.so.0 this dynamic link library.

Resolved as follows:

Vim/etc/profile//Add the following environment variable to the end of the file: Export ld_library_path= "$LD _library_path:/opt/wx/2.8/lib

execute after Save:source/etc/profile The configuration file to take effect immediately.

last command line start Codeblocks Success:

2. start with the desktop icon:

The desktop does not have an icon after the default installation and cannot be started by double-clicking. At this point we need to create the launcher:

Right-click on the desktop -->createlaucher:

Fill in the following information, then click OK:

at this point the desktop will produce Codeblocks icon, double click to start ( Note: If you do not start the double-click, you need to restart the system ) :

Six. does the new engineering test work correctly:

At this point we can compile successfully, but the runtime cannot eject the console window:

reason is CB The default startup is xterm , but not Gnome console, the workaround is as follows: Setings-->environment

When you click the Execute button, everything is OK:

Seven. Reference documents :

Http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux  Codeblocks Official tutorial http://www.cnblogs.com/zhanjindong/archive/2013/05/05/3061108.html CSDN Blog




Linux under the source installation Codeblocks

Related Article

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.