LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   GTK Installation on FC5 not working ! (https://www.linuxquestions.org/questions/linux-desktop-74/gtk-installation-on-fc5-not-working-490348/)

anksphenomenon 10-07-2006 10:41 AM

GTK Installation on FC5 not working !
 
Hi Guys,

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!

what to do? :((

reddazz 10-07-2006 12:09 PM

I think gtk and gtk2 are installed on your system. Maybe you need to install gtk2-devel in order for your programs to work. Can you post the output of
Code:

$rpm -qa | grep -i gtk

anksphenomenon 10-08-2006 11:39 PM

gtk+-1.2.10-50
gtkglext-1.2.0-3.fc5
gtkhtml-1.1.9-12
gtkglarea2-1.99.0-6.fc5
gtkhtml-devel-1.1.9-12
gtk-gnutella-0.96.1-1.fc5
gtkhtml2-devel-2.6.3-1.2.1
gtkglextmm-1.2.0-4.fc5
gtkmathview-devel-0.7.6-3.fc5
gtkglextmm-devel-1.2.0-4.fc5
gtk-engines-0.12-7.2.1
gtk-sharp2-gapi-2.8.2-1
gtk-sharp2-2.8.2-1
gtk2-devel-2.8.20-1
gtksourceview-1.6.2-1.fc5
gtkmm24-devel-2.8.8-1.fc5
gtkmathview-0.7.6-3.fc5
gtkspell-devel-2.0.11-1.2.1
gtkpod-0.99.4-1.lvn5
gtk-qt-engine-0.70-2.fc5
gtksourceview-devel-1.6.2-1.fc5
gtk-xfce-engine-2.2.8-2.fc5
gtkwave-3.0.12-1.fc5
gtk-sharp-gapi-1.0.10-5
gtkhtml36-3.6.2-4.fc5
gtksourceview-sharp-2.0-23.fc5
gtkhtml3-devel-3.10.3-1.fc5.1
gtk2-2.8.20-1
gtkmm24-2.8.8-1.fc5
gtk+extra-2.1.1-2.fc5
gtkglarea2-devel-1.99.0-6.fc5
gtkdatabox-devel-0.7.0.0-2.fc5
gtklp-1.2.2-1.fc5
gtk-doc-1.6-1.fc5.1
gtkhtml2-2.6.3-1.2.1
gtksourceview-sharp-devel-2.0-23.fc5
gtk+-devel-1.2.10-50
gtkglext-devel-1.2.0-3.fc5
gtkdatabox-0.7.0.0-2.fc5
gtkterm-0.99.5-1.fc5
gtktalog-1.0.4-7.fc5
gtk2hs-doc-0.9.10-1.fc5
gtkhtml36-devel-3.6.2-4.fc5
gtkspell-2.0.11-1.2.1
gtk+extra-devel-2.1.1-2.fc5
gtkmm24-docs-2.8.8-1.fc5
gtk2-engines-2.7.4-3
gtkhtml3-3.10.3-1.fc5.1
gtk-sharp-1.0.10-5

this is the list i got...
waiting ... :)

reddazz 10-09-2006 04:14 AM

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?

anksphenomenon 10-09-2006 06:52 AM

what i get compiling the file with :

gcc -v test1.c -o test1 `pkg-config --cflags --libs gtk+`

is this :

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

when i specify the package as 2.0, with :

gcc -v test1.c -o test1 `pkg-config --cflags --libs gtk+-2.0`


i get :


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)

anksphenomenon 10-09-2006 07:03 AM

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...

anksphenomenon 10-18-2006 12:49 PM

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 :)


All times are GMT -5. The time now is 07:56 AM.