LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Installing GTK (https://www.linuxquestions.org/questions/ubuntu-63/installing-gtk-565441/)

User Name. 06-29-2007 02:14 PM

Installing GTK
 
I want to install GTK as I want to learn about GUI programming, and also implement GUI into a few programs of my own. I am completely capable of install GTK from source if I really wanted to, but I would rather just apt-get it, and save some time. I have looked through synaptic, and nothing has caught my attention; though I may have missed something. If that is true, then I am sorry for posting this, otherwise, what package should I apt-get?

MS3FGX 06-29-2007 02:26 PM

GTK will already be installed on your system, as it is a critical system component if you are using graphical applications on the machine.

User Name. 06-29-2007 03:03 PM

Quote:

Originally Posted by MS3FGX
GTK will already be installed on your system, as it is a critical system component if you are using graphical applications on the machine.

Hmm...there isn't a header in /usr/include:
Code:

/usr/include$ ls
aio.h        assert.h      elf.h      fpu_control.h  gpilotd      limits.h    netash      nss.h      regex.h      signal.h    sysexits.h  ustat.h
aliases.h    autosprintf.h  endian.h    fstab.h        grp.h        link.h      netatalk    obstack.h  regexp.h    spawn.h      syslog.h    utime.h
alloca.h    bits          envz.h      fts.h          iconv.h      linux      netax25    paths.h    resolv.h    stab.h      tar.h        utmp.h
a.out.h      byteswap.h    err.h      ftw.h          ieee754.h    locale.h    netdb.h    poll.h    rpc          stdint.h    termio.h    utmpx.h
argp.h      c++            errno.h    _G_config.h    ifaddrs.h    malloc.h    neteconet  printf.h  rpcsvc      stdio_ext.h  termios.h    values.h
argz.h      complex.h      error.h    gconv.h        inttypes.h    math.h      netinet    protocols  sched.h      stdio.h      tgmath.h    wait.h
ar.h        cpio.h        execinfo.h  gdict-1.0      langinfo.h    mcheck.h    netipx      pthread.h  scsi        stdlib.h    thread_db.h  wchar.h
arpa        crypt.h        fcntl.h    getopt.h        lastlog.h    memory.h    netpacket  pty.h      search.h    string.h    time.h      wctype.h
asm          ctype.h        features.h  gettext-po.h    libgen.h      mntent.h    netrom      pwd.h      semaphore.h  strings.h    ttyent.h    wordexp.h
asm-generic  dbus-1.0      fenv.h      glob.h          libgpilotdCM  monetary.h  netrose    python2.4  setjmp.h    stropts.h    ucontext.h  X11
asm-i386    dirent.h      fmtmsg.h    gnu            libintl.h    mqueue.h    nfs        python2.5  sgtty.h      sys          ulimit.h    xlocale.h
asm-x86_64  dlfcn.h        fnmatch.h  gnu-versions.h  libio.h      net        nl_types.h  re_comp.h  shadow.h    syscall.h    unistd.h

In the gtk tutorials, they #include <gtk/gtk.h>, and there is no gtk directory, nor a gtk.h.

I do however have these directories:
Code:

/usr/lib$ echo gtk*
gtk-2.0 gtkhtml gtk-sharp-2.0

Maybe a whereis or slocate (which outputs more lines then can fit in the terminal) command?

MS3FGX 06-30-2007 06:41 AM

Strange, it must be an Ubuntu-specific thing then. On my Slackware machine, the GTK header files are included with the binary packages.

Code:

tj@T-Bird:/usr/lib$ locate "gtk.h"         
/usr/include/gtk-1.2/gtk/gtk.h
/usr/include/gtk-2.0/gtk/gtk.h
/usr/include/wx-2.8/wx/gtk/win_gtk.h
/usr/include/wx-2.8/wx/gtk/assertdlg_gtk.h
/usr/include/wx-2.8/wx/gtk/tbargtk.h
/usr/include/wx-2.8/wx/gtk/treeentry_gtk.h
/usr/include/pygtk-2.0/pygtk/pygtk.h

As you can see, they are right where the GTK tutorials are referencing them "/gtk/gtk.h". Perhaps there is some development GTK package that needs to be installed. Check for something along the lines of "libgtk-dev".

pixellany 06-30-2007 08:01 AM

My system (Mepis) did not install this by default--even though GTK itself is there.

The package is libgtk2.0-dev

User Name. 06-30-2007 07:23 PM

MS3FGX:
You are comparing Slackware to Ubuntu; obviously Slackware wins that. The only reason I don't run Slackware is my wireless card. And Ubuntu doesn't even come with gcc installed by default. You expect the gtk headers to be there too?

I had installed that package and gtk.h is in /usr/include/gtk-2.0/gtk/gtk.h by default, and #include <gtk/gtk.h> works fine.

Thanks for your help.


All times are GMT -5. The time now is 01:32 PM.