1. SIGSEGV when calling c_func with 4.1.0
- Posted by Mihail121 Mar 05, 2015
- 1635 views
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 .
2. Re: SIGSEGV when calling c_func with 4.1.0
- Posted by andi49 Mar 06, 2015
- 1644 views
Hallo
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
3. Re: SIGSEGV when calling c_func with 4.1.0
- Posted by BRyan Mar 07, 2015
- 1600 views
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})
4. Re: SIGSEGV when calling c_func with 4.1.0
- Posted by jimcbrown (admin) Mar 07, 2015
- 1530 views
-- don't you need a return variable integer ret_value = c_func(f, {NULL, NULL})
Not for 4.0 or 4.1
5. Re: SIGSEGV when calling c_func with 4.1.0
- Posted by Mihail121 Mar 07, 2015
- 1503 views
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!