GTK + development environment settings in Ubuntu

Source: Internet
Author: User
Tags gtk

Install the gnome and GTK + development libraries and run the following command:Sudo apt-Get install libgtk2.0-dev libgnome2-dev
After installation, all related header files and static/dynamic library files are ready.

 

 

Eclipse development:

 

 

 

  1. Required Installation
    1. To install JDK, run the following command:Sudo apt-Get install sun-java6-sdk
    2. After installing eclipse + CDT 5.0, I think CDT has gradually become a climate since 5. As an eclipse developer, I think it is better than kdevelop :). Unfortunately, Windows does not support msvc, only through mingw or cygwin
    3. Install the gnome and GTK + development libraries and run the following command:Sudo apt-Get install libgtk2.0-dev libgnome2-dev
      After the installation, all related header files and static/dynamic library files are ready, so you have to say apt-Get is really Nb.
  2. Test
    1. the header file uses the command PKG-config -- cflags GTK +-2.0
      , normally, the following result is displayed:
      -I/usr/include/gtk-2.0-I/usr/lib/gtk-2.0/include
      -I/usr/include/atk-1.0-I/usr/include/Cairo -I/usr/include/pango-1.0
      -I/usr/include/glib-2.0-I/usr/lib/glib-2.0/include
      -I/usr /include/FreeType2-I/usr/include/libpng12-I/usr/include/pixman-1
    2. command PKG-config -- libs GTK +-2.0
      , normally, the following result is displayed:
      -lgtk-x11-2.0-lgdk-x11-2.0-latk-1.0-lgdk_pixbuf-2.0-LM
      -lpangocairo-1.0-lpango-1.0-lcairo-lgobject-2.0-lgmodule-2.0-LDL
      -lglib-2.0
  3. Start eclipse, create a C Project, right-click Properties> C/C ++
    build-> Settings, in Tool Setting, we will set the header file directory and link library for GCC (another way is to customize make
    file, which calls PKG-config because no explicit settings are made, CDT cannot perform static analysis and cannot use its powerful functions, such as indexing and restructuring ).
    1. set the header file, click gcc C compiler-> directories, and run the PKG-config -- cflags GTK +-2.0 | SED's // n/G'> include.txt
      , then run the SED's/-I // G' shortde.txt
      , add each row to the inclue path in sequence.
    2. set the library, click gcc C linker-> libraries, and run the PKG-config -- libs GTK +-2.0 | SED's // n/G'> lib.txt
      , then run the SED's/-l // G' lib.txt
      , add each row to libraries in sequence.
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.