I. source code package
1. GNU make Tool
2. GNU gettext package (required when the system does not have the gettext () function)
3. GNU libiconv Library (required when the system does not have the iconv () function)
4. fontconfig Library
Fontconfig provides system-wide font settings, customization, and application permission. Program Function library.
5. FreeType Library
GTK + (based on directfb) font painting is completed through pango + FreeType + fontconfig. fontconfig is responsible for font management and configuration, and FreeType is responsible for drawing a single character, pango completes the text layout. FreeType is a function library for operating fonts. It can not only process dot matrix fonts, but also a variety of Vector Fonts, including TrueType fonts, providing a unified Calling Interface for upper-layer applications.
6. libpng library
The libpng package contains the libpng library, which is used by other programs to read and write PNG files. The PNG Library is used to create and operate PNG format graphics files. PNG format is designed to replace GIF. It has made a lot of progress and expansion for a smaller range of TIFF (marking image file formats) and reduced the trouble of patent rights.
7. parse SRC Library
JPEG Algorithm Compressed file.
8. Tiff Library
The TIFF library is used by many programs to read and write TIFF files.
9. PKG-config Tool
Pkgconfig includes the PKG-config program, which is used to pass the header file inclusion path or library file path to the compiler in the compilation script.
For GTK + and its dependent libraries that support the PKG-config tool, the search path of the header file of the library is changed to the search path of the. PC file .. The search path of the PC file is set through the Environment Variable pkg_config_path. PKG-config searches the file in the order of the set path until the specified. PC file is found.
10. Glib Library
Glib is the underlying core library of GTK + and gnome projects. It provides many useful definitions and functions when creating gdk and GTK applications, is a lightweight C library for comprehensive purposes. It provides definitions of common data structures and related processing functions in C language, and interesting and practical macros, portable encapsulation and some runtime capabilities, such as event loops, threads, dynamic calls, object systems, and other APIs.
11. ATK Library
The ATK package contains the ATK library. ATK is short for the accessibility toolkit (accessibility toolkit. ATK provides a framework for all gtk2 programs to meet the accessibility requirements.
12. Cairo Database
Cairo is a cross-platform open Source code Vector Graphics function library to provide high-quality display and print output. Cairo provides a stable user-layer API that provides modern graphic processing and management capabilities, such as drawing and filling, ing conversion, and merging (note that this is a synthesis) with the change of Alpha translucent image, highly real text display and so on. The same output can be achieved on different media sets.
13. pango Database
The pango Library provides underlying text orchestration generation functions, a set of high-level functions for generating the entire text layout, and functions for editing multi-country texts.
14. GTK + Library
The first five items are generally included in the new Linux version. Note that if the installation path of GTK is/opt/GTK, in addition to/opt/GTK/lib/pkgconfig, add/usr/lib/pkgconfig. Because the. PC files of the library installed in the system are in/usr/lib/pkgconfig, you must set the path clearly when you want to use these built-in libraries when installing GTK.
The most important and negligible problem when collecting the source code packages required to install GTK is the matching of versions between packages. I ignored this problem when installing GTK, and it took a lot of turns. The simplest way to solve this problem is to log on to the GTK + Website ": ftp://ftp.gtk.org/pub/gtk, and download various source code packages in the region. On this site, each GTK version is compatible with the source code package in a folder. For example, if you choose to install GTK v2.6, you only need to download the packages at ftp://ftp.gtk.org/pub/gtk/v2.6. However, if you select v2.6, you should pay attention to one issue. The pango packages supporting GTK v2.6 have two versions: 1.8.0, 1.8.1, and 1.8.0, when GTK is installed, the pango library cannot be found. I was the victim of this version, and it took a long time to connect to the pango library when installing GTK. Later I saw a foreigner on the internet saying that this version has a bug and only version 1.8.1 can be used. Mom's! Isn't that difficult!
According to the dependency requirements, the library should be installed in such order: glib, ATK, Cairo, pango, GTK +.
Ii. Settings
LD_LIBRARY_PATH and pkg_config_path are set as follows:
> Export LD_LIBRARY_PATH =/opt/GTK/lib: $ LD_LIBRARY_PATH
> Export pkg_config_path =/opt/GTK/lib/pkgconfig: $ pkg_config_path
Note: If you want to use the existing fontconfig, FreeType, and other libraries in the system, you must add the original library of the system:
> Export LD_LIBRARY_PATH =/usr/lib
> Export LD_LIBRARY_PATH =/opt/GTK/lib: $ LD_LIBRARY_PATH
> Export pkg_config_path =/usr/lib/pkgconfig
> Export pkg_config_path =/usr/x11r6/lib/pkgconfig: $ pkg_config_path
> Export pkg_config_path =/opt/GTK/lib/pkgconfig: $ pkg_config_path
The environment variables LD_LIBRARY_PATH and pkg_config_path are only valid for the current terminal window. In the terminal window without the above settings, PKG-config cannot find the. PC file of the new installation library, which may cause subsequent installation to fail. (I am making a simple mistake that causes serious consequences, so I would like to vomit blood to remind everyone)
3. Install the source code package
The GTK version I installed is v2.6. The source package used includes: jpegsrc.v6b.tar.gz?libpng-1.2.8.tar.bz2, Tiff-modified, and ATK-modified. Put them all in the root directory.
Install GTK + and its dependent library settings in the same directory/opt/GTK, instead of occupying a different directory for each library, which can facilitate later database settings. In addition, you can delete this directory to remove GTK + and its dependent libraries.
1. Install pkgconfig
> Tar zxvf pkgconfig-0.15.0.tar.gz
> Cd/root/pkgconfig-0.15.0
>./Configure
> Make
> Make install
Echo $? Check whether the installation is successful. If the output value is 0, the configuration is successful. If the output value is 0, the configuration fails. In Linux, you can use this method to check the value that a command or program returns to the system after it ends. Generally, 0 indicates that the program is successful, and non-0 indicates that the program exits unexpectedly.
2. Install glib
> Tar zjvf glib-2.6.6.tar.bz2
> Cd/root/glib-2.6.6
>./Configure -- prefix =/opt/GTK
> Make
> Make install
3. Install ATK
> Tar zjvf atk-1.9.0.tar.bz2
> Cd/root/atk-1.9.0
>./Configure -- prefix =/opt/GTK
> Make
> Make install
4. Install Cairo
> Tar zxvf cairo-1.2.4.tar.gz
> Cd/root/Cairo-1.2.4
>./Configure -- prefix =/opt/GTK -- With-X -- enable-win32 = No
> Make
> Make install
5. Install pango
> Tar zxvf cairo-1.2.4.tar.gz
> Cd/root/Cairo-1.2.4
>./Configure -- prefix =/opt/GTK -- libdir =/opt/GTK/lib -- With-x
> Make
> Make install
6. Install libpng
> Tar zjvf libpng-1.2.8.tar.bz2
> Cd/root/libpng-1.2.8
> Make prefix =/opt/GTK \ zlibinc =/opt/GTK/include zliblib =/opt/GTK/lib-F scripts/makefile. Linux
> Make prefix =/opt/GTK install-F scripts/makefile. Linux
7. Install LibTIFF (that is, TIFF)
> Tar zxvf tiff-v3.6.1.tar.gz
> Cd/root/tiff-v3.6.1
>./Configure -- prefix =/opt/GTK -- noninteractive \ -- with-DIR_MAN =/opt/GTK/share/man
> Make
> Make install
8. Install libjpeg (that is, javassrv)
> Tar zxvf restart src.v6b.tar.gz
> Cd/root/jpeg-6b
>./Configure -- enable-static -- enable-shared -- prefix =/opt/GTK
> Make
> Make install
Note: by default, JPEG does not share libraries. Therefore, you must manually specify -- enable-shared. Note this when installing Lib.
10. Install GTK
> Tar zjvf gtk0000-2.6.9.tar.bz2
> Cd/root/GTK +-2.6.9
>./Configure -- prefix =/opt/GTK -- With-X -- without-libjpeg
> Make
> Make install
Iv. Check whether GTK is correctly installed
To verify whether GTK is correctly installed, write a simple program using GTK to create a 200x200 window.
V. Compile and install wxgtk on Linux platform (taking wxGTK-2.6.2 as an example)
Download wxgtk-2.6.2.tar.gz, where the http://www.wxwidgets.org is located.
After the download, enter the following command for installation:
Tar zxvf wxGTK-2.6.2.tar.gz
CD wxGTK-2.6.2
./Configure -- enable-XRC -- enable-monolithic -- enable-Unicode
Make
Make install
If no error message is displayed, the installation is smooth and the compilation process is slow.
3. The library file path points to the correct path
Because the path is not specified when wxgtk is installed, wxgtk is mounted to/usr/local/lib. If it points to the path,
This step can be omitted after the "-Prefix =/usr" parameter is added.
Library file path pointing method:
VI/etc/lD. So. conf
At the end of the file, enter:
/Usr/local/lib
After adding, run:
/Sbin/ldconfig
4. Installation Verification
You can use the following output to check whether the installation is correct:
WX-config -- prefix
WX-config -- libs
Which WX-config
5. Download Code: Block
Download it at http://www.codeblocks.org/downloads/
: Http://ncu.dl.sourceforge.net/sourceforge/codeblocks/codeblocks-8.02-src.tar.bz2
Run the following command to install the SDK:
Tar jxf codeblocks-8.02-src.tar.bz2
CD codeblocks-8.02
./Configure-Prefix =/usr
Make
Make install
If no error message is displayed, the installation is smooth and the compilation process is slow.
6. Start and create shortcuts
Right-click the desktop, select "create initiator", and enter the following path:
/Usr/bin/codeblocks
NOTE: If codeblocks cannot be run after the setup, disable SELinux and restart and try again.
This article is from the "Freedom House" blog,
Source http://yuliang.blog.51cto.com/626833/276195