Compiling GTK+ Applications
Hello. I wanted to start GTK+ application programming and I was following this tutorial: http://developer.gnome.org/gtk-tutorial/2.90/c39.html
When I run
Code:
pkg-config --cflags --libs gtk+-2.0
I get the following error
Code:
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
Please help.
Incidentally, can we also use gtk+-3.0 to create apps in Quantal?
Re: Compiling GTK+ Applications
You'll need to install libgtk2.0-dev in order to have the required header files for 2.x.
That said, PLEASE don't program with GTK+ 2.x: 3.x is stable, and has been for a while now. Unless you have very good reason to do so, you're just making work for yourself later. There's a similiar tutorial for 3.x here: http://developer.gnome.org/gtk3/3.0/...g-started.html
...and a reference manual here: http://developer.gnome.org/gtk3/stable/
Re: Compiling GTK+ Applications
Quote:
Originally Posted by
MG&TL
Well, I'll take heed of your advice then. I've just started, so it'll be easy to switch. But I do get the same error when I link gtk+-3.0 with pkg-config. Do I then need to install libgtk3.0-dev to solve this problem?
Re: Compiling GTK+ Applications
Thank you MG&TL. Your hint to install libgtk2.0-dev led me to deduce that I had to install libgtk-3-dev in order to compile GTK 3.x apps. My code compiled successfully.
Re: Compiling GTK+ Applications
Quote:
Originally Posted by
madnag4u
Thank you MG&TL. Your hint to install libgtk2.0-dev led me to deduce that I had to install libgtk-3-dev in order to compile GTK 3.x apps. My code compiled successfully.
Awesome. :) Sorry I wasn't around, my mother was going beserk.
Good luck with GTK+, it's a great toolkit, just a bit difficult to get your head around at first.
Re: Compiling GTK+ Applications
Quote:
Originally Posted by
MG&TL
Gtk+ 3 might be stable but there are no official binaries for Windows yet! It's a massive pain in the rear for those developing cross platform software. Is Gtk+3 even cross platform? I know I'll be using Gtk 2 until they are released.
Re: Compiling GTK+ Applications
Quote:
Originally Posted by
SuperCamel
Gtk+ 3 might be stable but there are no official binaries for Windows yet! It's a massive pain in the rear for those developing cross platform software. Is Gtk+3 even cross platform? I know I'll be using Gtk 2 until they are released.
Still cross-platform.
Sorry though, I thought they'd be binaries by now. :( Might be worth seeing if you can build it from source and put an unofficial release out?