Install gnome and gtk + Development Library, use the command: sudoapt-getinstalllibgtk2.0-devlibgnome2-dev, after installation, all the relevant header files and static/dynamic library files are ready for eclipse development: install the necessary things install JDK, use the command: sudoapt-getinstallsun-java6-sdk install eclipse + CDT5.0, I think CD install gnome and gtk + Development Library, use the command:
Sudo apt-get install libgtk2.0-dev libgnome2-devAfter 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-devAfter the installation, all related header files and static/dynamic library files are ready, so you have to say apt-get is really NB.
- Test
- Header file commandPkg-config -- cflags gtk ++-2.0Under normal circumstances, the following results will appear:
-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
- Library file commandPkg-config-libs gtk +-2.0Under normal circumstances, the following results will appear:
-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 new 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 then use the commandPkg-config -- cflags gtk +-2.0 | sed's // \ n/G'> include.txtAnd then use the commandSed's/-I // G' include.txtAdd each row to the inclue path in sequence.
- Set the library, click gcc c Linker-> Libraries, and then use the command like the header file.Pkg-config -- libs gtk +-2.0 | sed's // \ n/G'> lib.txtAnd then use the commandSed's/-l // G' lib.txtTo add each row to libraries.