[ubuntu-uk] GTK and C

Pat evilcorporation at gmail.com
Wed Nov 15 23:04:20 GMT 2006

On 15/11/06, Greg Dash <greg.dash1 at gmail.com> wrote:
> I already have pkg-config installed, could it be a config problem?
> On 15/11/06, Andrew Price <andy at andrewprice.me.uk > wrote:
> >
> > On 15/11/06 15:24, Greg Dash wrote:
> > > gcc `gtk-config --cflags`  -Wimplicit " gtk2.c" -lgtk` gtk-config
> > > --libs` -o "gtk2"
> >
> > gtk-config is provided in libgtk1.2-dev but you want to use
> > libgtk2.0-dev, which provides .pc files for pkg-config to use. Hence you
> > probably need to use pkg-config instead of gtk-config.
I'm no expert on GTK so beware of inaccuracies here... but I think the point
is that gtk-config provides information about the libraries that need to be
included into your application for a GTK1.2 application, and pkg-config is
for GTK2.0.

If you are intending to compile a GTK2 (the current version) application
then your compile command would probably look something like

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

Have a look at http://www.gtk.org/tutorial/c39.html for the helloworld

Talking of IDEs, I'd be interested in hearing any opinions on the free Linux
development tools.

I haven't used anjuta much, I found the way it sets up its compile options
confusing! It seemed to behave very bizarrely with the pkgconfig for gtkmm,
the C++ wrapper for GTK.

I also had a play with Eclipse CDT for C/C++ and didn't like that either, so
I've been using gvim for an editor, CGDB for the debugger and building
little shellscripts to use as compile scripts.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-uk/attachments/20061115/a3cb418b/attachment.htm 

More information about the ubuntu-uk mailing list