[Gtk-sharp-list] Compiling dynamic dll on windows

Andoni Morales Alastruey ylatuya at gmail.com
Tue Jun 17 21:47:29 EDT 2008


Hi!

I would like to know how to compile GTK dynamic libraries for win32 for
creating C# bindings.
On linux I compile the library for a Gtk widget I wrote on C, than I
create the bindings with the gapi tools and all works fine. Instead,on
windows, I compile the library, I use the bindings I created before and
all works if I don't connect any of the 3 signals sended by my GTK
widget. But if I add any handler to the widget events
(this.timescale1.InChanged += new
LongoMatch.InChangedHandler(this.OnStartValueChanged);), and a the
signal "in_changed" is sent, my app finishes without any info.

Running "mono test.exe" I get a System.AccesViolationException : Trying
to read or write in the protected memory.

Running "mono -v test.exe" the output is more interesting, as we can see
the signal is caught and processed and that the aplication is deading in
the callback method (OnChanged())

Method (wrapper managed-to-native)
System.Object:__icall_wrapper_mono_delegate_ctor (object,object,intptr)
emitted at 00F71DC0 to 00F71E06 (code length 70) [test.exe]
Method LongoMatch.GtkTimescale :
add_InChanged(LongoMatch.InChangedHandler) emitted at 00F71E20 to
00F71E74 (code length 84) [test.exe]
Method (wrapper native-to-managed)
LongoMatch.GtkTimescale:InChangedSignalCallback (intptr,double,intptr)
emitted at 00F71E78 to 00F71EE8 (code length 112) [test.exe]
Method Gtk.Application:Run () emitted at 00F71EF8 to 00F71F02 (code
length 10) [test.exe]
Method (wrapper managed-to-native) Gtk.Application:gtk_main () emitted
at 00F71F10 to 00F71F4D (code length 61) [test.exe]
Method
LongoMatch.GtkTimescale:InChangedSignalCallback(intptr,double,intptr)
emitted at 00F71F50 to 00F720E5 (code length 405) [test.exe]
Method LongoMatch.InChangedArgs:.ctor () emitted at 00F72128 to 00F72136
(code length 14) [test.exe]
Method GLib.SignalArgs:.ctor () emitted at 00F72148 to 00F7216A (code
length 34)[test.exe]
Method System.EventArgs:.ctor () emitted at 00F72178 to 00F7217D (code
length 5)[test.exe]
Method System.EventArgs:.cctor () emitted at 00F72180 to 00F721A5 (code
length 37) [test.exe]
Method GLib.SignalArgs:set_Args (object[]) emitted at 00F721A8 to
00F721B6 (codelength 14) [test.exe]
Method GLib.SignalArgs:get_Args () emitted at 00F721B8 to 00F721CC (code
length20) [test.exe]
Method GLib.Signal:get_Handler () emitted at 00F721D0 to 00F7226C (code
length 156) [test.exe]
Method (wrapper managed-to-native)
GLib.Signal:g_signal_get_invocation_hint (intptr) emitted at 00F72288 to
00F722CF (code length 71) [test.exe]
Method (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:PtrToStructure
(intptr,System.Type) emitted at 00F722D0 to 00F72316 (code length 70)
[test.exe]
Method (wrapper runtime-invoke)
GLib.InvocationHint:runtime_invoke_void_intptr_object
(object,intptr,intptr,intptr) emitted at 00F72318 to 00F723B2 (code
length154) [test.exe]
Method (wrapper unknown) GLib.InvocationHint:PtrToStructure
(intptr,object) emitted at 00F723B8 to 00F72449 (code length 145)
[test.exe]
Method GLib.Object:GetObject (intptr) emitted at 00F72450 to 00F7246B
(code length 27) [test.exe]
Method GLib.Object:GetObject (intptr,bool) emitted at 00F72478 to
00F725C5 (codelength 333) [test.exe]
Method System.Collections.Hashtable:KeyEquals (object,object) emitted at
00F72608 to 00F7267E (code length 118) [test.exe]
Method System.IntPtr:Equals (object) emitted at 00F72680 to 00F726FB
(code length 123) [test.exe]
Method GLib.ToggleRef:get_IsAlive () emitted at 00F72710 to 00F72799
(code length 137) [test.exe]
Method GLib.ToggleRef:get_Target () emitted at 00F727A0 to 00F72848
(code length168) [test.exe]
Method test.MainWindow:onChanged (object,object) emitted at 00F72848 to
00F7284D(code length 5) [test.exe]

Stacktrace:
at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004>
at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
at Gtk.Application.Run () <0x00007>
at test.MainWindow.Main (string[]) <0x00021>
at (wrapper runtime-invoke) test.MainWindow.runtime_invoke_void_string[]
(object,intptr,intptr,intptr) <0xffffffff>
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
C:\Documents and Settings\ubuntu\Mis documentos\Proyectos\LongoMatch
\test\bin\Debug>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080618/ba8a3d21/attachment-0001.html 


More information about the Gtk-sharp-list mailing list