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:
-
- Required Installation
- To install JDK, run the following command:Sudo apt-Get install sun-java6-sdk
- 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
- 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.
- Test
- 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
- 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
- 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 ).
- 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.
- 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.