CentOS Build Gtk+codeblock full version _linux

Source: Internet
Author: User
Tags bz2 cairo data structures gettext gtk centos
First, the required source code package
1. GNU Make Tool
2. GNU GetText software package (required when there is no GetText () function on the system)
3. GNU Libiconv Library (required when there is no iconv () function on the system)
4. Fontconfig Library
Fontconfig is a library of functions that provides system-wide font settings, customizing, and allowing applications to access.
5. FreeType Library
GTK + (DIRECTFB) font drawing is done through pango+freetype+fontconfig collaboration, where Fontconfig is responsible for the management and configuration of fonts, FreeType responsible for drawing individual characters, Pango completes the layout of the text. FreeType is a function library for manipulating fonts, which can handle not only dot-matrix fonts, but also multiple vector fonts, including TrueType fonts, providing a unified calling interface for upper-level applications.
6. Libpng Library
The Libpng package contains libpng libraries that are used by other programs to read and write PNG files. The PNG library is a graphic file used to create and manipulate PNG formats. PNG format is designed to replace GIF, and it has made a lot of progress and expansion in smaller TIFF (Tagged Image file format) and reduced the hassle of patent rights.
7. JPEGSRC Library
Ability to compress files using the JPEG algorithm.
8. TIFF Gallery
The TIFF library is used by many programs to read and write TIFF files.
9.pkg-config Tools
Pkgconfig includes the Pkg-config program, which is used to pass the header file include 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 setting of the search path for the header file of the library becomes the setting for the. pc file search path. The search path for the PC file is set by the environment variable Pkg_config_path, pkg-config Searches in the order of the set path until the specified. pc file is found.
GLib Library
GLib is the underlying core library of GTK + and GNOME Engineering, the library provides a number of useful definitions and functions when creating GDK and GTK applications, and is an integrated, practical, lightweight C program library that provides definitions of commonly used data structures in C language, related processing functions, interesting and practical macros, portable encapsulation, and some run-time functions, such as event loops, threads, dynamic invocations, object systems, and so on.
ATK Library
The ATK package contains the ATK library. ATK is the abbreviation for the Accessibility Toolbox (Accessibility Toolkit). ATK provides a framework for all GTK2 programs to address accessibility requirements.
Cairo Library
Cairo is a cross-platform, open source vector graphics function library that provides high quality display and print output. Cairo provides a stable user layer API that provides modern graphics management capabilities such as drawing and filling, mapping transformations, compositing (note, synthesis) with changing alpha semitransparent images, high fidelity text display, and more. The ability to achieve the same output on different media.
Pango Library
The Pango library provides the underlying text choreography rendering function, a set of high-level functions to generate the entire text layout, and a function to help edit the multinational text.
GTK + Library
The first five of these are generally compared to the new Linux version, the system will bring itself. One issue to note is that if the GTK installation path is/OPT/GTK, in addition to adding/opt/gtk/lib/pkgconfig in Pkg_config_path, add/usr/lib/pkgconfig. Because the. pc files are installed in the/usr/lib/pkgconfig of the system, you must set the path clearly when you want to use the libraries that come with these systems when you install GTK.
One of the most important things you can do to collect the source packages needed to install GTK is the problem of matching versions between packages. I was in the installation GTK ignored the problem, the result went a lot of detours. The easiest way to solve this problem is to login to GTK + 's website: ftp://ftp.gtk.org/pub/gtk, download the various source packages on it. At this site, each GTK version of the compatible source package is placed under one folder. For example, I choose to install GTK v2.6, just download the packages in ftp://ftp.gtk.org/pub/gtk/v2.6. However, choose V2.6 friend to pay serious attention to a problem, support GTK V2.6 Pango package has two version -1.8.0, 1.8.1,1.8.0 is a failed version, if you choose it, in the installation of GTK will not find the Pango library. I was the victim of this version, and it took a long time to connect to the Pango library when I installed GTK, and then I saw a foreigner on the internet saying that this version has bugs and can only use the 1.8.1 version. Oh, it! It's not deceptive!
Depending on the requirements of the dependencies, the installation of the library should follow this sequence: GLib, ATK, Cairo, Pango, GTK +.
Second, set up
Mainly includes the Ld_library_path and the Pkg_config_path setting, specifically as follows:
> Export ld_library_path=/opt/gtk/lib: $LD _library_path
> Export pkg_config_path=/opt/gtk/lib/pkgconfig: $PKG _config_path
Note that if you want to use the existing fontconfig, FreeType and other libraries in the system, you need to 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
One thing that can easily be overlooked is that Ld_library_path and Pkg_config_path are only valid for the current terminal window. If you are in a terminal window that does not have the above settings, Pkg-config will not be able to find the. pc file for the new Installation library, which may cause subsequent installations to fail. (A simple but serious result of their own mistakes, vomiting blood to remind everyone OH)
Third, the source code package installation
The GTK version I installed is v2.6, and the source package used includes: jpegsrc.v6b.tar.gz, libpng-1.2.8.tar.bz2, tiff-v3.6.1.tar.gz, pkgconfig-0.15.0.tar.gz, GLIB-2.6.6.TAR.BZ2, atk-1.9.0.tar.bz2, cairo-1.2.4.tar.gz, pango-1.8.1.tar.bz2, gtk+-2.6.9.tar.bz2. Put them all in the home directory of root.
Installing GTK + and its dependent library settings into the same directory/OPT/GTK, rather than using each library to occupy a different directory, can be convenient for future library settings. Also, you can simply remove this version of GTK + and its dependent libraries in the future by deleting the directory.
1. Install Pkgconfig

> Tar zxvf pkgconfig-0.15.0.tar.gz
> cd/root/pkgconfig-0.15.0
>/configure
> Make
> Make Install
At the end of each process, you can use the echo $? Check to see if the installation was successful. If the output is 0, the configuration succeeds, and a number outside 0 indicates that the configuration failed. On a Linux system, you can use this method to check how much a command or program returns to the system after it is finished. The general 0 represents success, 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 (just jpegsrv)
> Tar zxvf jpegsrc.v6b.tar.gz
> cd/root/jpeg-6b
>/configure--enable-static--enable-shared--prefix=/opt/gtk
> Make
> Make Install
NOTE: JPEG default does not share the library, so to manually specify the--enable-shared, the general installation of Lib This is to be noted.
10. Install GTK
> Tar zjvf gtk+-2.6.9.tar.bz2
> cd/root/gtk+-2.6.9
>/configure--prefix=/opt/gtk--with-x--without-libjpeg
> Make
> Make Install
Check whether the correct installation of GTK
To verify that GTK is properly installed, use GTK to write a simple program that creates 200x200 sized windows
Five: the Linux platform to compile and install WXGTK (take wxGTK-2.6.2 as an example)
Download wxgtk-2.6.2.tar.gz, location http://www.wxwidgets.org.
After downloading, enter the following command to install:
Tar zxvf wxgtk-2.6.2.tar.gz
CD wxGTK-2.6.2
./configure--ENABLE-XRC--enable-monolithic--enable-unicode
Make
Make install
If there are no error prompts, the installation is relatively smooth, in the compilation process is relatively slow.
3, the library file path point to the correct
Because, we did not specify the path when installing WXGTK, therefore, WXGTK is loaded under/usr/local/lib, of course if pointed to the path,
That is, after adding the "-prefix=/usr" parameter, you can omit this step.
The library file path points to the method:
Vi/etc/ld.so.conf
At the end of the file enter:
/usr/local/lib
After joining, run:
/sbin/ldconfig
4. Installation Verification
You can check that the installation is correct through the output of the following actions:
Wx-config--prefix
Wx-config--libs
Which Wx-config
5. Download Code::block
Download in http://www.codeblocks.org/downloads/
Download Address: http://ncu.dl.sourceforge.net/sourceforge/codeblocks/codeblocks-8.02-src.tar.bz2
After downloading, enter the following command to install:
Tar jxf codeblocks-8.02-src.tar.bz2
CD codeblocks-8.02
./configure–prefix=/usr
Make
Make install
If there are no error prompts, the installation is relatively smooth, in the compilation process is relatively slow.
6. Start and create shortcuts
Right-click on the desktop, select Create Initiator, and enter the following path:
/usr/bin/codeblocks
Note: After the erection is completed, if you cannot run Codeblocks, please turn the SELinux off and reboot and try again.
This article comes from "Freedom House" blog,
SOURCE http://yuliang.blog.51cto.com/626833/276195
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.