GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Dec 19, 2014 6:13 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: on debian, which gtk or gnome pacakages am i missing
PostPosted: Mon Jan 02, 2012 11:29 pm 
Offline
GTK+ Geek

Joined: Sun Dec 04, 2011 9:29 pm
Posts: 71
Location: Seattle, WA
i am trying to port something that builds under ubuntu but will not build under debian. tte functions or macros are:

gtk_widget_is_sensitive and gtk_widget_set_sensitive?

anybody?


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Tue Jan 03, 2012 12:07 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
ummm.... these functions are all def.d in gtk.h so if you can compile anything then you should be able to use thee functions. What version are you using? can you include your makefile/build command as well as any error messages when ompiling?


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Tue Jan 03, 2012 12:28 am 
Offline
GTK+ Geek

Joined: Sun Dec 04, 2011 9:29 pm
Posts: 71
Location: Seattle, WA
Paul Childs wrote:
ummm.... these functions are all def.d in gtk.h so if you can compile anything then you should be able to use thee functions. What version are you using? can you include your makefile/build command as well as any error messages when ompiling?


I have the latest debian stuff: on ubuntu, there were only warning that ui can fix, on my laptop are the following errors:
Quote:
pts/1 15:27 <chatter> [432] k ~/bin
gcc -std=gnu99 -Wall -g main.c -o main -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
main.c: In function ‘show_file_in_new_window’:
main.c:157: warning: implicit declaration of function ‘chdir’
main.c: In function ‘inc_button_click_cb’:
main.c:244: warning: implicit declaration of function ‘GTK_WIDGET_SET_SENSITIVE’
main.c: In function ‘dec_button_click_cb’:
main.c:278: warning: implicit declaration of function ‘gtk_widget_is_sensitive’
main.c: In function ‘voice_editor’:
main.c:362: warning: statement with no effect
main.c:363: warning: implicit declaration of function ‘sleep’
main.c: In function ‘main’:
main.c:417: warning: unused variable ‘Size’
main.c:416: warning: unused variable ‘message’
/tmp/ccrEmJn4.o: In function `inc_button_click_cb':
/home/kline/bin/main.c:244: undefined reference to `GTK_WIDGET_SET_SENSITIVE'
/tmp/ccrEmJn4.o: In function `dec_button_click_cb':
/home/kline/bin/main.c:278: undefined reference to `gtk_widget_is_sensitive'
collect2: ld returned 1 exit status
make: *** [all] Error 1
pts/1 15:27 <chatter> [433]


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Tue Jan 03, 2012 1:01 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Quote:
i have the latest debian stuff

That's not entirely true. From your linking line I can see your running off version 2.0. The functions you're after are new in version 2.18 http://developer.gnome.org/gtk/stable/api-index-2-18.html#idxW. You'll want to make sure that you have at least this version installed and if you're using pkgconfig in a configure file to detect the libraries available then to specify at least version 2.18. The capitalised macro GTK_WIDGET_SET_SENSITIVE does not exist (use the lower case function instead).

I see you're also using chdir. For cross-platform programming you're better off moving to the more portable glib functions (e.g. g_chdir etc.)


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Tue Jan 03, 2012 1:14 am 
Offline
GTK+ Geek

Joined: Sun Dec 04, 2011 9:29 pm
Posts: 71
Location: Seattle, WA
SIRE, I honestly appreciate your help....
the 6+ years of work i did in hacking Xlib and Xaw have helped ... but not much.
um, okay, i'll put back the last _SET_SENSITIVE in lower case and see if it still makes.

i've got a ton of reading to do, as if that weren't obvious ... but i grateful for my felllow geeks!

fwiw, i did not write the makefile. previously i used mkmf, now i'm at a loss, so if you can point me to the real line i should tweaek, i'd much appreciate ie.


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Tue Jan 03, 2012 6:32 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 799
Location: UK
Hi,

Which version of Debian are you using? The latest version is Debian Squeeze (6) which uses GTK+ 2.20, so ‘gtk_widget_is_sensitive’ should be there, if you have all the development libraries installed. If you are using Lenny (5) then it will not be there.

Although Ubuntu is derived from Debian, it does not follow it exactly and does not follow the stable releases which is currently Squeeze (6). Debian has 3 main distributions which are old stable (Lenny 5), stable (Squeeze 6 this is the current release), testing (Wheezy 7) and there is also unstable which is always called Sid and is not really meant to be used for day to day stuff.

_________________
E.


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Tue Jan 03, 2012 10:12 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Sorry my bad, didn't realise that the packages are referred to as 2.0 for the purpose of compiling irrespective of version.

If you want to check the version try:
apt-cache show libgtk2.0-0 | grep Version
if the package is named something different on debian you could try:
apt-cache search libgtk
to track it down.

For the sleep function have you included unistd.h?

Are you able to include code from around each of your warnings? Sometimes errors propagate and are only noticed later. I think I sometimes get implicit declarations at odd places when I forget semicolons and stuff like that.

If you move to an autotools format (which is useful as the configure stage will help you in making your compilation easier cross-platform) an example configure.ac file (that uses gettext for translation support and gnome documentation) would be (the version you can control in the PKG_CHECK_MODULES line):
Code:
AC_PREREQ([2.65])
AC_INIT([yourfilename],[yourversion#],[your@email],[packagename],[url])
AC_CONFIG_SRCDIR([src/main.h])
AC_CONFIG_AUX_DIR([confsupp])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_GNU_GETTEXT([external])
GNOME_DOC_INIT
AC_PROG_CC([gcc cc])
AC_CONFIG_HEADERS([config.h])
PKG_CHECK_MODULES([YOURLIBMACRO], [gtk+-2.0 >= 2.14])
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])
AC_OUTPUT()


A makefile.am in your root directory as:
Code:
SUBDIRS= doc po src
Applicationsdir=$(datadir)/applications
Applications_DATA=yourfile.desktop
pixmapdir=$(datadir)/pixmaps
pixmap_DATA=pixmaps/icon.png
EXTRA_DIST=confsupp/gnome-doc-utils.make \
   ABOUT-NLS confsupp/config.rpath m4/ChangeLog \
   AUTHORS ChangeLog COPYING COPYING-DOCS INSTALL NEWS README TODO \
   $(pixmap_DATA) $(Applications_DATA) \
   configure.ac
DISTCHECK_CONFIGURE_FLAGS= --disable-scrollkeeper
ACLOCAL_AMFLAGS = -I m4


and one in your source directory as:
Code:
AM_CFLAGS=$(YOURLIBMACRO_CFLAGS)
AM_CPPFLAGS= -DLOCALEDIR=\"$(localedir)\" -DPACKAGE=\"$(PACKAGE)\"
bin_PROGRAMS=yourfilename
yourfilename_SOURCES=      \
   main.c         \
   main.h         \
   otherstuff.c         \
   otherstuff.h
Harmonic_LDADD=$(YOURLIBMACRO_LIBS)


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Wed Jan 04, 2012 3:35 am 
Offline
GTK+ Geek

Joined: Sun Dec 04, 2011 9:29 pm
Posts: 71
Location: Seattle, WA
pts/1 19:26 <chatter> [519] ~
pts/1 19:27 <chatter> [519] apt-cache show libgtk2.0-0 | grep Version ~
Version: 2.12.12-1~lenny2

is what grep caught. i dont have a clue what 'lenny is', :), but at least it looks as tho i'm at 2.12+

...i just caught a bug that i didnt catch from a return call. hopefully, this will keep me in the

while(!done) loop!

thanks for your help; i will get back to you.


Top
 Profile  
 
 Post subject: Re: on debian, which gtk or gnome pacakages am i missing
PostPosted: Wed Jan 04, 2012 7:52 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 799
Location: UK
Hi,

Lenny is the Debian distribution, which is what is known as OLD STABLE (version 5). The current stable is known as Squeeze (version 6) and this has much more up to date GTK libraries which is GTK 2.20 is in this distribution. The distributions are named after Pixar Toy Story characters, with the experimental being always called Sid after the boy who broke all the toys.

So if you want to use the later GTK libraries you may want to consider upgrading your distribution to Squeeze.

Also if you want to find the version of some development library you could use.
Code:
pkg-config --modversion gtk+-2.0
at the command line. So for me I get the result of 2.24.8, but then I am using Debian testing which is called Wheezy.

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group