[Gtk-sharp-list] Re: win32 patch stuffs
08 Oct 2002 21:37:57 -0700
Ugh. win32 patch got held up because it was too big. URL to patch,
attached to this is a corrected glue/win32dl.c, and the following is the
text from the previous email.
Current problem: it looks like the dll has exports like "_gtksharp_...",
and the runtime is trying to import "gtksharp_...". Hmm.
Url to patch: http://www.vlad1.com/~vladimir/win32.patch
Ok, there's a bunch of little changes in this patch, some correct, some
not so correct. It builds, but executables still claim they can't find
gtksharpglue.dll.. i'm trying to figure that out now. Anyway, here's a
general list of patches:
- glib/LibraryNames.cs has a set of const strings that define the dlls.
Things like GLib.LibraryNames.GTK_LIB (Yes, this should be in the
GtkSharp namespace, but I chose it wrong the first time and I didn't
want to re-sed everything. Can easily be changed.)
- sources/gtk-sharp.sources lib names changed to these strings
- generator taught to not output ""s around "library" names that
with GLib (should be GtkSharp).
- api/*.xml files are manually patched by this patch
- api/makefile.win32 added to generate code
- glue/makefile.win32 added to build a mingw32 DLL. this is MOSTLY
CORRECT, but it doesn't quite seem to work, or the dll's are not being
searched for correctly, or something.
- glue/win32dll.c - dll entry points. this is the most likely culprit
in the dll not working; i'm looking up docs in a sec on how to do this
right, just wanted to get this patch out.
- generator/Parameters.cs: don't claim that params that have "void" as
the cstype are Valid (*** necessary for mcs now as well, since the void
type fix went in toady)
- generator/SignalHandler.cs: signal handler marshallers
("voidPropertyBlahSignal") or whatever are now put in the
GtkSharp.<BaseNamespace>Signals namespace instead of
GtkSharp.<BaseNamespace>. This fixes the problem with csc of it
resolving namespaces against current ones (so you couldn't use
Gtk.Widget from GtkSharp.Gtk.xxx).
- generator/makefile.win32: removed codegen line, put it in the
- various *.custom, glib/*.cs files: removed hard-coded library names
and changed to references of the const strings
- gtk/Table.custom: commented out the extra no-argument default
constructor, because one with the same signature but a different
protection level was being auto-generated. mcs does not complain about
this, csc does -- most likely a mcs bug. The default constructor here
is useful, but not horribly so.
That should be it. I'm building with mingw32 installed from cygwin with
a full cygwin/gnu toolchain (but using mingw32 for the actual build
tools). win32 libs of gtk+2 and related are from
Content-Disposition: attachment; filename=win32dll.c
Content-Type: text/x-c; name=win32dll.c; charset=ANSI_X3.4-1968
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
BOOL APIENTRY DllMainCRTStartup (HINSTANCE hInst, DWORD reason, LPVOID rese=