GTK & C & Sarge

Hi All,
I'm teaching myself how to build GUI's using the C api to GTK by following a tutorial. The tutorial program follows:

Quote:

include "gtk/gtk.h"
int main( int argc, char *argv[] )
{
GtkWidget *window;

gtk_init (&argc, &argv);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);

gtk_main ();

return 0;
}

The command line from the tutorial follows:

Quote:
gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0`

gcc complaint follows:

Quote:
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found

What all do I need to install of GTK to use the GTK libraries in a C program?
I did verify that gtk/gtk.h exists on my system.

Thank you,
VajraBro

0

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

GTK & C & Sarge

So I assume you have installed all the necessary dev files? E.g. libglib2.0 libgtk2.0 ? I haven't done anything in gtk for a while, but as I recall, documentation, especially http://developer.gnome.org/doc/API/2.0/gtk/index.html was enough for me to understand what should I use and where in order to compile and link my code.

But, it seems that something is wrong with pkg-config. Did you try to find gtk+-2.0.pc file? When I type "locate gtk+-2.0.pc" i find it in /usr/lib/pkgconfig/ directory.

GTK & C & Sarge

oh, yes. I would also check file permissons. Many times this was the answer to my problems

gtk+-2.0.pc is Missing

gtk+-2.0.pc is missing! I'll try to find and install it and report my findings.

Thanks 1.
VajraBro

Dependency issues with gtk+-2.0.pc

Hi 1,
Which version of Debian are you running?
Gary

So Why Not Use Glade?

All,
I decided to move ahead with GUI development and installed Glade using synaptic. My thinking was that the installation bundle might contain files necessary to solve my original gcc command line problem. Glade, by the way, works just fine as a G code generator and my hat is off to the designers! Unfortunately I now have another problem.

When I run autogen.sh I get the following complaint:

Quote:
gary@garyt20:~/Projects/project1$ sh autogen.sh
**Error**: You must have `glib' installed.
You can get it from: ftp://ftp.gtk.org/pub/gtk

I'm hesitant to install glib from ftp://ftp.gtk.org/pub/gtk because of potential package synchronization problems. So just install glib using synaptic, right? Wrong. When I try to install glib, I get the following "unresovable dependency" complaint from synaptic.
Quote:
libglib2.0-dev:
Depends: libglib2.0-0 (=2.6.4-1) but 2.10.2-0bpo1 is to be installed
My second question is how do I correct the package dependency problem?

By the way, my struggle with low level X10 continues: See my previous post Sarge and Xlib.h. If anybody has ideas on that problem please let me know and I'll test them out and if they work I'll add them to the post. A solution will be helpful to anyone interested in X10 programming.

Peace to all,
VajraBro

So Why Not Use Glade?

Uh, I seem to remember that there was either glade version for glib 2 or separate controls which use 2.0 version. But, I can't say anything precise.

Backport version of glib

Hi VajraBro

You seem to have installed a backported version of glib (2.10) on your Sarge box currently. Did you remove that backport source from APT sources.list?

Make sure it is still there. Add it again if needed:

echo "deb http://www.backports.org/debian sarge-backports main contrib non-free" >> /etc/apt/sources.list

Now try to install libglib2.0-dev by referring to the Sarge backport explicitly:

aptitiude update
aptitude -t sarge-backports install libglib2.0-dev

The dependency should then be solved.
Also, install libglade2-dev.

Cheers, Georg

PS: Of course, adding the new source to APT is also possible from Synaptic and installing the glib2.0-dev package after adding that source is too.
Go to Settings → Repositories and verify that the backport.org source is available. Update and select the libglib2.0-dev and libglade2-dev packages for installation.

Backport version of glib

Thanks Georg. I'll post a progress report in a day or so.
VajraBro

Syndicate content