A Installation Platform Description:
Two Download the latest source code:
Http://www.codeblocks.org/downloads
Installed here is the latest version: Code::Blocks 16.01
Three Read the official Installation documentation:
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:
The installation codeblocks has the following dependencies:
Code::blocks-> Xwwidget (> libwxGTK2.8)-> GTK + (> libgtk-x11-2.0)->x
Four Start by installing the following dependencies:
mkdir ~/devel//home directory Create devel directory, this directory name can be arbitrarily specified
2. Install 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/
Be careful to choose the following source package, and don't choose the wrong:
Copy the downloaded source to the previously created directory: ~/devel/, and then unzip:
1 mv./desktop/wxgtk-2.8.12.tar.gz devel///Copy the Desktop WXGTK source package to the previously established working directory Devel
2 CD devel///Enter Devel directory
3 tar zxvf wxgtk-2.8.12.tar.gz//Uncompressed Source pack
Enter the wxGTK-2.8.12 directory to execute the following command:
mkdir Build_gtk2_shared_monolithic_unicode//Build Compilation Directory
CD Build_gtk2_shared_monolithic_unicode//Enter the newly built directory
.. /configure–prefix=/opt/wx/2.8–enable-xrc–enable-monolithic–enable-unicode//Execute Configure script file
Make//Start compilation
SU//Switch to root
Make install//start installation
The installation process is as follows:
By performing the steps above, you can see that makefile has been generated, and you can compile it now:
Compile complete, start installing make install:
SU root//switch to root user
Make install//start installation
The following message appears to indicate that the WXGTK library installation is complete:
4. All the above preparations have been completed, now start to install Code::Blocks:
The CB source is also copied to our previously created working directory: ~/devel, and then enter the source directory:
Mv.. /desktop/codeblocks-16.01.release/.///Copy Codeblocks source package to current directory (devel/)
CD codeblocks.16.01.release///Access source directory
Copy the WXWIN.M4 under wxGTK-2.8.12 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, execute./bootstrap:
To begin executing the Configure script:
//Note that the/opt/wx/2.8/bin/wx-config path here should be the path you install WXGTK
./configure-with-wx-config=/opt/wx/2.8/bin/wx-config
Switch to root installation:
SU root//switch to root user
Make install//start installation
At this point you can see that the codeblocks is installed:
1. Start by command line:
All of the above steps have Codeblocks installed on the Linux system, but we have a problem when we start directly:
The reason is that libwx_gtk2u-2.8.so.0 is not found in this dynamic link library.
Vim/etc/profile
Add the following environment variables to the end of the file:
//Note that the/opt/wx/2.8/lib path here should be the path you install WXGTK
Export ld_library_path= "$LD _library_path:/opt/wx/2.8/lib
Execute after Save: source/etc/profile Let the configuration file take effect immediately.
The last command line started Codeblocks successfully:
2. Through the desktop icon to start:
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 initiator:
Right-click on the desktop –>createlaucher:
Fill in the following information and click OK:
At this point the desktop will produce codeblocks icon, double-click to start (Note:
if double-click to start, you need to restart the system can ):
Six Whether the new engineering test will work correctly:
At this point we can compile successfully, but the runtime cannot eject the console window:
The reason is that CB defaults to start with the xterm, rather than the GNOME console, the solution is as follows: Setings–>environment
此时点击执行按钮时一切正常: