[Ilugc] gtk configuration problem

  • From: ravi@xxxxxxxxxx (Ravi Pratap M)
  • Date: 26 Aug 2002 10:00:35 -0400

Hi Vignesh,


First gtk(2.0.0) required pango(1.0.0), atk(1.0.0), pkg-config(0.12.0) and 
glib(2.0.0).  I downloaded and installed all the packages in the following 
way:
#./configure  - in the respective director
#make install
#make check
#make

        I am assuming that you did ./configure without specifying a prefix -
that means that it used /usr/local for the prefix.


A simple program of the sort
#include <gtk/gtk.h>

int main()
{
return 1;
}

A book guides to compile the program as
gcc example.c 'gtk-config -cflags' 'gtk-config -line'.  I have also tried 
using -I option with gcc.  No gains.

But I could not find gtk-config command in my system.

        This was for Gtk 1.2. Gtk 2.0 onwards the Pkg Config system is used so
you need to do :


        pkg-config --cflags gtk+-2.0 


        to get the include lines and C flags needed to build a program and 


        pkg-config --libs gtk+-2.0


        to get the list of libraries to link against :-)



        So your command line would look like :


        gcc `pkg-config --cflags --libs gtk+-2.0` example.c



        HTH,


                Ravi


Other related posts: