Re: gtklib

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu