Results 1 to 9 of 9

Thread: install GTK

  1. #1
    Join Date
    Aug 2006
    Beans
    42

    install GTK

    what would i apitude(can this be used as a verb?) if i want to start tinkering around with gtk+ with C?

  2. #2
    Join Date
    Nov 2006
    Location
    Udine, Italy
    Beans
    28

    Re: install GTK

    sudo aptitude install gnome-core-devel build-essential

    and then, here is a tutorial.
    www.gtk.org/tutorial.

    moreover, here there should be a post you may find interesting, http://ubuntuforums.org/showthread.php?t=400956

  3. #3
    Join Date
    Aug 2006
    Beans
    42

    Re: install GTK

    i tried that but it didn't work--compiling a test helloworld file results in a unknown header error

    gcc: pkg-config --cflags --libs gtk+-2.0: No such file or directory
    gtk.c:1:21: error: gtk/gtk.h: No such file or directory
    gtk.c: In function ‘main’:
    gtk.c:6: error: ‘GtkWidget’ undeclared (first use in this function)
    gtk.c:6: error: (Each undeclared identifier is reported only once
    gtk.c:6: error: for each function it appears in.)
    gtk.c:6: error: ‘window’ undeclared (first use in this function)
    gtk.c:7: error: ‘label’ undeclared (first use in this function)
    gtk.c:11: error: ‘GTK_WINDOW_TOPLEVEL’ undeclared (first use in this function)
    gtk.c:17: error: ‘gtk_main_quit’ undeclared (first use in this function)
    gtk.c:18: error: ‘NULL’ undeclared (first use in this function)
    alvin@alvin-linuxbox:~$ gcc -o gtk gtk.c pkg-config --cflags --libs gtk+-2.0
    gcc: pkg-config: No such file or directory
    gcc: gtk+-2.0: No such file or directory
    cc1: error: unrecognized command line option "-fcflags"
    cc1: error: unrecognized command line option "-flibs"
    Last edited by NooBeee; April 8th, 2007 at 01:47 PM.

  4. #4
    Join Date
    Nov 2006
    Location
    Udine, Italy
    Beans
    28

    Re: install GTK

    that's my same problem.
    when you compile try this that should work
    gcc -o helloworld helloworld.c `pkg-config --cflags --libs gtk+-2.0`

  5. #5
    Join Date
    Aug 2006
    Beans
    42

    Re: install GTK

    lol....there was nothing wrong my gtk install.... i was tying a comma instead of the `

  6. #6
    Join Date
    Mar 2008
    Beans
    1

    Re: install GTK

    I am now facing the same problem,too. What was wrong? Or may be the command sudo aptitude install gnome-core-devel build-essential still not enough.

  7. #7
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: install GTK

    I fear that's some obsolete method... or one that is applied from some other distro... whatever, I never had heard of such gnome-core-devel package before.

    Use:
    Code:
    sudo apt-get install libgtk2.0-dev
    (and also install "build-essential" if you haven't).

    But also, I highly recommend you to install GTK+'s docs and the very nice GNOME's Devhelp documentation browser (which you will be able to access from Applications->Programming):
    Code:
    sudo apt-get install libgtk2.0-doc devhelp

  8. #8
    Join Date
    Jun 2006
    Location
    The Netherlands
    Beans
    2,185
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: install GTK

    You compile a GTK+ program like this:
    Code:
    gcc hello.c -o hello `pkg-config --cflags --libs gtk+-2.0`
    Note the use of backticks ` instead of straight quotes '.
    Ubuntu 12.04

  9. #9
    Join Date
    Sep 2008
    Beans
    3

    Re: install GTK

    thanks nvteighen and jespdj...

    its work now...

    so install gtk in ubuntu:

    Code:
    sudo apt get install gnome-core-devel build-essential install libgtk2.0-dev libgtk2.0-doc devhelp
    Last edited by p0c4r1; March 17th, 2009 at 05:58 AM.

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
  •