Re: SIGSEGV when calling c_func with 4.1.0

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

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 thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu