1. SIGSEGV when calling c_func with 4.1.0

Wonder if someone else has this issue. I am trying to get EuGTK with GTK 3.0 going on Windows 7, Euphoria 4.1.0. What I basically do is:

atom gtk = open_dll("libgtk-3-0.dll") 
atom f = define_c_func(gtk, "gtk_init_check", {C_POINTER, C_POINTER}, C_INT) 
c_func(f, {NULL, NULL}) 

Now when I run 'eui test.ex' the first 2 statements complete fine, but the third crashes the application and GDB reports a segmentation fault. I am using GTK 3.10.4 32-bit. Can anyone provide me with some hints?. The said function is found here https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-init-check .

new topic     » topic index » view message » categorize

2. Re: SIGSEGV when calling c_func with 4.1.0

Hallo

Mihail121 said...

Wonder if someone else has this issue. I am trying to get EuGTK with GTK 3.0 going on Windows 7, Euphoria 4.1.0. What I basically do is:

atom gtk = open_dll("libgtk-3-0.dll") 
atom f = define_c_func(gtk, "gtk_init_check", {C_POINTER, C_POINTER}, C_INT) 
c_func(f, {NULL, NULL}) 

Now when I run 'eui test.ex' the first 2 statements complete fine, but the third crashes the application and GDB reports a segmentation fault. I am using GTK 3.10.4 32-bit. Can anyone provide me with some hints?. The said function is found here https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-init-check .

That's maybe a problem with the calling convention. I think the Gtk-dll's use cdecl not stdcall.
From the manual:

On Windows, you can add a '+' character as a prefix to the function name. 
This indicates to Euphoria that the function uses the cdecl calling convention. 
By default, Euphoria assumes that C routines accept the stdcall convention. 

See also: http://openeuphoria.org/docs/std_dll.html#_5465_define_c_func

A few years ago i started to port EuGTK to Windows. You may follow this thread: http://openeuphoria.org/forum/118056.wc#118056

That's the post with the link to my source: http://openeuphoria.org/forum/m/118335.wc

Hope that helps get you starting

Andreas

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

3. Re: SIGSEGV when calling c_func with 4.1.0

Mihail121 said...

Wonder if someone else has this issue. I am trying to get EuGTK with GTK 3.0 going on Windows 7, Euphoria 4.1.0. What I basically do is:

atom gtk = open_dll("libgtk-3-0.dll") 
atom f = define_c_func(gtk, "gtk_init_check", {C_POINTER, C_POINTER}, C_INT) 
c_func(f, {NULL, NULL}) 

Now when I run 'eui test.ex' the first 2 statements complete fine, but the third crashes the application and GDB reports a segmentation fault. I am using GTK 3.10.4 32-bit. Can anyone provide me with some hints?. The said function is found here https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-init-check .

 
-- don't you need a return variable 
 
integer ret_value = c_func(f, {NULL, NULL}) 
 
new topic     » goto parent     » topic index » view message » categorize

4. Re: SIGSEGV when calling c_func with 4.1.0

BRyan said...
 
-- don't you need a return variable 
 
integer ret_value = c_func(f, {NULL, NULL}) 
 

Not for 4.0 or 4.1

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

5. Re: SIGSEGV when calling c_func with 4.1.0

Thanks for the help, everyone. Andreas nailed it. By changing the calling convention things went straight :) @Andreas, I'll give your port a look right away!

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

Search



Quick Links

User menu

Not signed in.

Misc Menu