Results 1 to 7 of 7

Thread: Compiling GTK+ Applications

  1. #1
    Join Date
    Sep 2010
    Beans
    7

    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?

  2. #2
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    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/

  3. #3
    Join Date
    Sep 2010
    Beans
    7

    Re: Compiling GTK+ Applications

    Quote Originally Posted by MG&TL View Post
    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/
    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?

  4. #4
    Join Date
    Sep 2010
    Beans
    7

    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.

  5. #5
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Compiling GTK+ Applications

    Quote Originally Posted by madnag4u View Post
    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.

  6. #6
    Join Date
    Apr 2012
    Beans
    39

    Re: Compiling GTK+ Applications

    Quote Originally Posted by MG&TL View Post
    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/
    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.

  7. #7
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Compiling GTK+ Applications

    Quote Originally Posted by SuperCamel View Post
    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?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •