1. RC1 64-bit error

constant setname = define_c_proc(GTK,"gtk_widget_set_name",{C_POINTER,C_POINTER}) 
----------------------------------- 
export function create(..... 
----------------------------------- 
-- do some stuff here 
c_proc(setname,{handle,allocate_string("ThisName")}) 
 

This works fine in hundreds of places with 32 bit, but on 64bit AMD running Linux Ultimate, Euphoria can't see the constant declared outside the function.

The same error message results if I define it separately, as follows:

atom setname 
  setname = define.... 

Error message is:

/home/irv/demos/GtkEngine.e:632 in function create()  
variable setname has not been assigned a value  

Moving the declaration inside the function works. I've tried making it a global constant, doesn't see that either.

However, if I move the declaration to the top of the file, it becomes visible to the function. ?

new topic     » topic index » view message » categorize

2. Re: RC1 64-bit error

irv said...
constant setname = define_c_proc(GTK,"gtk_widget_set_name",{C_POINTER,C_POINTER}) 
----------------------------------- 
export function create(..... 
----------------------------------- 
-- do some stuff here 
c_proc(setname,{handle,allocate_string("ThisName")}) 
 

This works fine in hundreds of places with 32 bit, but on 64bit AMD running Linux Ultimate, Euphoria can't see the constant declared outside the function.

That's very strange. My main machine is 64-bit, and I haven't seen this sort of thing. Since you're running RC1, there's a new utility that's shipping with it: eudist. It's really useful for grabbing all of the code required for a program.

Could you try:

$ eudist irv.ex 
..or whatever the real name is. It should pull the main file and all of the includes into a subdir named eudist (you can customize that with a command line option). Then, if you could post a tarball of that (or email it to me), I'd like to take a look.

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: RC1 64-bit error

Will do. The good news is, after moving the declaration (and making a couple of small changes to accomodate the diffs between GTK libraries) all of EuGTK works fine.

I did an eudist of the good and the bad, you can download the tarball here http://etcwebspace.com/users/irvm/eudist.tar.gz

new topic     » goto parent     » topic index » view message » categorize

4. Re: RC1 64-bit error

irv said...

Will do. The good news is, after moving the declaration (and making a couple of small changes to accomodate the diffs between GTK libraries) all of EuGTK works fine.

I did an eudist of the good and the bad, you can download the tarball here http://etcwebspace.com/users/irvm/eudist.tar.gz

Thanks. Yes, the problem was trying to use setname before it had been initialized. The "good" code works for me, too. Since other people may run into this situation (a similar thing happened recently in the standard library!), here's essentially what had happened:

constant foo = create() 
constant bar = define_c_func( lib, "bar", {}, C_POINTER ) 
 
function create() 
    return c_func( bar, {} ) 
end function 

This case was relatively easy to diagnose, since it was all in the same file. If two files include each other, however, it's important to move initialization to before the place where the other file is included, in order to make sure the initialization happens correctly.

Matt

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu