1. gtklib
- Posted by jstory at freenet.edmonton.ab.ca May 27, 2001
- 629 views
Two questions: 1. If I make a program using gtklib, is it supposed to work on both Linux and Windows? 2. When I try to run the examples on Windows (changing the extender from exu to exw), they don't work. I get an error message: gtklib.e: 40 in procedure gtk_init() c_proc/c_func: bad routine number (-1) called from gtklib.e: 620 What's with that? Jerry Story
2. Re: gtklib
- Posted by David Cuny <dcuny at LANSET.COM> May 27, 2001
- 570 views
Jerry Story wrote: > 1. If I make a program using gtklib, is it > supposed to work on both Linux and Windows? It works on my machine, but only if you have the correct DLLs loaded. You can find the current versions for Windows at: http://user.sgic.fi/~tml/gimp/win32/ It's been a *long* time since I've tried the code. There's a chance that the GTK library structures have changed since then (this is a know problem with dynamic linking, and with GTK in particular). I suspect that it will work, but you'll need to change the version number of the DLL - it's probably several versions past 1.3. > I get an error message: > gtklib.e: 40 in procedure gtk_init() > c_proc/c_func: bad routine number (-1) > called from gtklib.e: 620 The error message tells you that the call to c_proc failed because it had a "bad routine number" of -1. If you check the dump, you'll see that gtk_init_ has a value of -1. gtk_init_ is set a couple of lines above, with a call to link_c_proc, which is basically a thin wrapper around define_c_proc. A value of -1 means that define_c_proc wasn't able to find the routine "init_gtk" in the dll. If you look further, I'll bet that the value of GTK and GDK are zero. The documentation notes that they have a value of zero if Windows can't find the DLL. So basically, you tried to link routines in DLLs that weren't there, but because my code doesn't have good error checking, you didn't get an error until you finally tried to link to a function. Download the current DLLs, place them in the same directory as the code, and change the name of the DLLs from "1-3" to whatever they currently are, and it should work. I hope this helps! -- David Cuny
3. gtklib
- Posted by Chris Burch <chriscrylex at aol.com> Feb 10, 2002
- 602 views
Mostly for Irv Mullins, but for anyone who has any experience of the library. What assumptions do you make re the requirements to run the library. I seem to have gtk 1.2.8 installed (SuSE Linux system) - are there any other requirements? I can get the graphapp euphoria library to work. Chris.
4. Re: gtklib
- Posted by Irv Mullins <irvm at ellijay.com> Feb 10, 2002
- 575 views
On Sunday 10 February 2002 11:09 am, Chris Burch wrote: > What assumptions do you make re the requirements to run the library. > I seem to have gtk 1.2.8 installed (SuSE Linux system) - are there any > other requirements? > > I can get the graphapp euphoria library to work. Hi Chris: You'll need libgtk and libgdk, plus the little eugtk.so supplied with the package. I don't think the version matters a lot, I'm not using any bleeding-edge stuff here. So far, I've had no problem running this in Mandrake 7.1, 8.0, 8.1, RedHat 7.1, SuSE 6.4, or TurboLinux (something or other). Anyway, if you want to test to see if you can actually run any gtk programs, copy the following code and save it as gtkwin.c: /* Basic GTK+ app */ #include <gtk/gtk.h> gint main (gint argc, gchar *argv[]) { GtkWidget * TheWindow; gtk_init( &argc, &argv); TheWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(TheWindow); gtk_main(); return 0; } Next, compile it using gcc gtkwin.c -o gtkwin `gtk-config --cflags --libs` (Note: Those are back-tic's) If it compiles, the needed libraries must be there. If not, let me know what the error messages are. Regards, Irv
5. Re: gtklib
- Posted by Chris Burch <chriscrylex at aol.com> Feb 11, 2002
- 577 views
--part1_17b.370585a.2999ad23_boundary Irv Tried the compile with back ticks (as I should have done) - it compiled without any errors, so all the requisite parts of the gtk library appear to be there (can't test the window it produces, but I suspect it will produce one, since my (obviously) idiot compile method produced one. I will confirm it produces the test window tomorrow (sorry I'm at home at the moment, just compiled it using a dial in) I did try to run the gtk demos from an xterm (well konsole actually, looks nicer), but they just did nothing (actually used mc, with pause after run set on to make sure I don't miss anything exciting) - they didn't produce any errors or anything. KDE 2 incidentally. By the way, my curiosity is now piqued - what does `gtk-config --cflags --libs' do ? I think my monitors dying. Better go. Sorry to be so much trouble. Chris. --part1_17b.370585a.2999ad23_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: 7bit <HTML><FONT FACE=arial,helvetica><FONT SIZE=2>Irv <BR> <BR>Tried the compile with back ticks (as I should have done) - it compiled without any errors, so all the requisite parts of the gtk library appear to be there (can't test the window it produces, but I suspect it will produce one, since my (obviously) idiot compile method produced one. I will confirm it produces the test window tomorrow (sorry I'm at home at the moment, just compiled it using a dial in) <BR> <BR>I did try to run the gtk demos from an xterm (well konsole actually, looks nicer), but they just did nothing (actually used mc, with pause after run set on to make sure I don't miss anything exciting) - they didn't produce any errors or anything. KDE 2 incidentally. <BR> <BR>By the way, my curiosity is now piqued - what does `gtk-config --cflags --libs' do ? <BR> <BR>I think my monitors dying. Better go. Sorry to be so much trouble. <BR> <BR>Chris. --part1_17b.370585a.2999ad23_boundary--
6. Re: gtklib
- Posted by Irv Mullins <irvm at ellijay.com> Feb 11, 2002
- 561 views
On Monday 11 February 2002 06:26 pm, Chris Burch wrote: > I did try to run the gtk demos from an xterm (well konsole actually, looks > nicer), but they just did nothing (actually used mc, with pause after run > set on to make sure I don't miss anything exciting) - they didn't produce > any errors or anything. KDE 2 incidentally. I think I know what the problem is. libgtk has multiple dependencies (about a dozen) and each of those has its own dependencies. No doubt you are missing some library files that are needed. Rather than trying to track them all down, which could take days, why not just reload Mandrake. Choose "expert" mode, and select "Development Station" (something like that) as well as any others you want. (Web server, etc). Be sure to choose both Gnome and KDE as your GUI's of choice. That should load everything you need, as Elias pointed out. > By the way, my curiosity is now piqued - what does `gtk-config --cflags > --libs' do ? It's a program that returns a list of the libraries and where they're located. Much easier than typing in: -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm Regards, Irv
7. Re: gtklib
- Posted by Irv Mullins <irvm at ellijay.com> Mar 20, 2002
- 647 views
On Sunday 10 February 2002 11:09 am, Chris Burch wrote: > What assumptions do you make re the requirements to run the library. > I seem to have gtk 1.2.8 installed (SuSE Linux system) - are there any > other requirements? > > I can get the graphapp euphoria library to work. Hi Chris: You'll need libgtk and libgdk, plus the little eugtk.so supplied with the package. I don't think the version matters a lot, I'm not using any bleeding-edge stuff here. So far, I've had no problem running this in Mandrake 7.1, 8.0, 8.1, RedHat 7.1, SuSE 6.4, or TurboLinux (something or other). Anyway, if you want to test to see if you can actually run any gtk programs, copy the following code and save it as gtkwin.c: /* Basic GTK+ app */ #include <gtk/gtk.h> gint main (gint argc, gchar *argv[]) { GtkWidget * TheWindow; gtk_init( &argc, &argv); TheWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(TheWindow); gtk_main(); return 0; } Next, compile it using gcc gtkwin.c -o gtkwin `gtk-config --cflags --libs` (Note: Those are back-tic's) If it compiles, the needed libraries must be there. If not, let me know what the error messages are. Regards, Irv