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

Andoni Morales Alastruey ylatuya at gmail.com
Wed Jun 18 11:05:22 EDT 2008

Hi Cody:

I've thinking about this, and I think I don't need to do anything
special for Windows as I don't use any glue code. Generating the
bindings is just generating the C# code. I'll try to explain the
situation a little bit.
My C library is just a GTK Widget (GtkTimeScale), witch is a kind of
scale with three cursors. The first one delimits the start, the second
one the position, and the third one the stop. This widget cand send 3
signals :
Witch are sended when one of the cursor is moved.
On Linux I comple the library and I use the C# code generated by the
GAPI tools: all works great. On windows I do the same, I compile the
lbrary and I use the C# code generate by the GAPI tools.
If I don't connect any of the three signals, the widget is displayed and
I can move the cursors without any problem. The problem comes when I add
an event handler for one of the 3 signals. When I move the cursor the
signal is sended and caught and my app finishes.
I'm having the same problem with  Gstreamer player. I compile the C libs
for the GstPlayer, I run my app with the GstPlayer bindings, and all
works well. The movie is playing on Windows (When I saw it for the first
time I was really happy because I was having a C# multiplatform video
player) but when the movie reaches the final and the end_of_stream event
is sended, the app deads again. 
I don't really know why because 2 months ago I din have this problem. I
have tried to compile it on Visual studio with cygwin and mingw, and
always with the same result. I don't know how to debug  it...
Can I send you the sources so you can try to comple it and execute it?

By the way I notice just at the beginning of the execution of my test
app (a simple window with the gtktimescale) this:
Method (wrapper runtime-invoke) System.Object:runtime_invoke_void_string
(object,intptr,intptr,intptr) emitted at 00F60028 to 00F600BD (code
length 149) [test.exe]
Method System.OutOfMemoryException:.ctor (string) emitted at 00F600C0 to
00F600E3 (code length 35) [test.exe]
Method System.SystemException:.ctor (string) emitted at 00F60100 to
00F60123 (code length 35) [test.exe]Method System.Exception:.ctor
(string) emitted at 00F60130 to 00F60148 (code length 24) [test.exe]
Method System.Exception:set_HResult (int) emitted at 00F60148 to
00F60156 (codelength 14) [test.exe]Method
System.NullReferenceException:.ctor (string) emitted at 00F60158 to
00F6017E (code length 38) [test.exe]
Method System.StackOverflowException:.ctor (string) emitted at 00F60180
to 00F60196 (code length 22) [test.exe]

El mar, 17-06-2008 a las 22:57 -0500, Cody Russell escribió:
> On Wed, 2008-06-18 at 03:47 +0200, Andoni Morales Alastruey wrote:
> > 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
> Okay, trying to understand what your problem is here.. it sounds like
> you're binding your own C library?  Do you have any "glue" code that
> sits between the managed code and the C library?  For example, Gtk# has
> some additional C code and you obviously can't build the binding itself
> on Linux and expect it to work on Windows.
> So it sounds like you may want to build the binding on Windows and not
> copy them over from Linux.  But I may be misunderstanding the problem.
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

More information about the Gtk-sharp-list mailing list