Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to make a desktop application on GTK,C.
I tried to yum install gtk* on my system.
I think there was gtk already installed on my system since i have xmms running.
when i tried running the first program from the gtk.org tutorial, it ran fine. but when i did the hello world program, it gave me compile errors. This led me to compile
as 'gcc -v ...... gtk+' . this way i saw that the compilation is picking files from gtk1.2 and NOT gtk 2.0 that was supposedly installed by yum.
so I did a yum remove gtk* (and ran into trouble with my system so updated kde and gnome packages :P)
then i again did a yum install gtk* but it still gives me compile errors. a google told me that it needs gtk2.0 to work! and i think I installed it!
Well gtk2-devel is installed fine so if your program does indeed use gtk2 and not gtk, I don't see why its not being picked up. Are you using examples from the gtk2 tutorial or the gtk 1.x tutorial?
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
/usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -quiet -v -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include test1.c -quiet -dumpbase test1.c -mtune=generic -auxbase test1 -version -o /tmp/ccbvUPsy.s
ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/gtk-1.2
/usr/include/glib-1.2
/usr/lib/glib/include
/usr/local/include
/usr/lib/gcc/i386-redhat-linux/4.1.1/include
/usr/include
End of search list.
GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1) (i386-redhat-linux)
compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1).
GGC heuristics: --param ggc-min-expand=62 --param ggc-min-heapsize=60374
Compiler executable checksum: 7a31534f101210f86e6343d2c0c239f8
In file included from /usr/include/features.h:329,
from /usr/include/limits.h:27,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/limits.h:122,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/syslimits.h:7,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/limits.h:11,
from /usr/lib/glib/include/glibconfig.h:9,
from /usr/include/glib-1.2/glib.h:66,
from /usr/include/gtk-1.2/gdk/gdktypes.h:33,
from /usr/include/gtk-1.2/gdk/gdk.h:31,
from /usr/include/gtk-1.2/gtk/gtk.h:31,
from test1.c:1:
/usr/include/sys/cdefs.h:313:27: error: bits/wordsize.h: No such file or directory
In file included from /usr/include/features.h:352,
from /usr/include/limits.h:27,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/limits.h:122,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/syslimits.h:7,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/limits.h:11,
from /usr/lib/glib/include/glibconfig.h:9,
from /usr/include/glib-1.2/glib.h:66,
from /usr/include/gtk-1.2/gdk/gdktypes.h:33,
from /usr/include/gtk-1.2/gdk/gdk.h:31,
from /usr/include/gtk-1.2/gtk/gtk.h:31,
from test1.c:1:
/usr/include/gnu/stubs.h:11:3: error: #error "unexpected value for __WORDSIZE macro"
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/limits.h:122,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/syslimits.h:7,
from /usr/lib/gcc/i386-redhat-linux/4.1.1/include/limits.h:11,
from /usr/lib/glib/include/glibconfig.h:9,
from /usr/include/glib-1.2/glib.h:66,
from /usr/include/gtk-1.2/gdk/gdktypes.h:33,
from /usr/include/gtk-1.2/gdk/gdk.h:31,
from /usr/include/gtk-1.2/gtk/gtk.h:31,
from test1.c:1:
/usr/include/limits.h:145:30: error: bits/posix1_lim.h: No such file or directory
/usr/include/limits.h:149:30: error: bits/posix2_lim.h: No such file or directory
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
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
/usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -quiet -v test1.c -quiet -dumpbase test1.c -mtune=generic -auxbase test1 -version -o /tmp/ccGaEy5R.s
ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/i386-redhat-linux/4.1.1/include
/usr/include
End of search list.
GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1) (i386-redhat-linux)
compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1).
GGC heuristics: --param ggc-min-expand=62 --param ggc-min-heapsize=60374
Compiler executable checksum: 7a31534f101210f86e6343d2c0c239f8
test1.c:1:21: error: gtk/gtk.h: No such file or directory
test1.c:5: error: expected ‘)’ before ‘*’ token
test1.c:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘delete_event’
test1.c:30: error: expected ‘)’ before ‘*’ token
test1.c: In function ‘main’:
test1.c:40: error: ‘GtkWidget’ undeclared (first use in this function)
test1.c:40: error: (Each undeclared identifier is reported only once
test1.c:40: error: for each function it appears in.)
test1.c:40: error: ‘window’ undeclared (first use in this function)
test1.c:41: error: ‘button’ undeclared (first use in this function)
test1.c:48: error: ‘GTK_WINDOW_TOPLEVEL’ undeclared (first use in this function)
test1.c:56: error: ‘delete_event’ undeclared (first use in this function)
test1.c:56: error: ‘NULL’ undeclared (first use in this function)
test1.c:62: error: ‘destroy’ undeclared (first use in this function)
test1.c:74: error: ‘hello’ undeclared (first use in this function)
test1.c:80: error: ‘gtk_widget_destroy’ undeclared (first use in this function)
and whats the deal with package config file?
whats it used for ?
i have tried putting the package name (not gtkdevel but the gtk2.0 etc) but it didnt quite make a difference...
it so happened that the latest version available for download has rpms that are fc6 dependent! and I have FC5! and i came to know that only when i was asked for a version of i think atk that was an fc6 version :P
i think they should mention it there on the site that this downloadable version is for fc6..
My GTK is running fine now though thanks for all the trouble
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.