what would i apitude(can this be used as a verb?) if i want to start tinkering around with gtk+ with C?
what would i apitude(can this be used as a verb?) if i want to start tinkering around with gtk+ with C?
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
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.
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`
lol....there was nothing wrong my gtk install.... i was tying a comma instead of the `
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.
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:
(and also install "build-essential" if you haven't).Code:sudo apt-get install libgtk2.0-dev
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
You compile a GTK+ program like this:
Note the use of backticks ` instead of straight quotes '.Code:gcc hello.c -o hello `pkg-config --cflags --libs gtk+-2.0`
Ubuntu 12.04
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.
Bookmarks