LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 06-29-2007, 02:14 PM   #1
User Name.
Member
 
Registered: Aug 2006
Distribution: Ubuntu 8.04
Posts: 178

Rep: Reputation: 30
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?
 
Old 06-29-2007, 02:26 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
GTK will already be installed on your system, as it is a critical system component if you are using graphical applications on the machine.
 
Old 06-29-2007, 03:03 PM   #3
User Name.
Member
 
Registered: Aug 2006
Distribution: Ubuntu 8.04
Posts: 178

Original Poster
Rep: Reputation: 30
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?
 
Old 06-30-2007, 06:41 AM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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".
 
Old 06-30-2007, 08:01 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

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

The package is libgtk2.0-dev
 
Old 06-30-2007, 07:23 PM   #6
User Name.
Member
 
Registered: Aug 2006
Distribution: Ubuntu 8.04
Posts: 178

Original Poster
Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing the gtk Elbryan Linux - Software 10 10-13-2007 01:17 AM
Installing Mono-got stuck while installing gtk-sharp chutsu Linux - Software 11 01-18-2005 08:25 PM
installing gtk+ minm Linux - Software 1 10-26-2004 09:20 PM
installing GTK+ 2.4.2 Vindane Linux - Software 3 06-05-2004 05:20 PM
Installing gtk+ help saiz66 Linux - Software 6 06-21-2003 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration