openmedicus / gtk-sharp

DEPRECATED: Use https://github.com/GLibSharp/GtkSharp or https://github.com/GtkSharp/GtkSharp
Other
22 stars 6 forks source link

A question over the build process #15

Closed Hecatron closed 8 years ago

Hecatron commented 8 years ago

Hi,

I've been trying to build the latest version of GTK3 and GTKSharp from this repo under windows however I've been struggling to get the build process to work

Under a regular windows command prompt I clone this repo

cd C:\gtk-build\gtksharp
git clone https://github.com/openmedicus/gtk-sharp.git

under a MSYS2 / MinGw 32bit console window I install a few different packages

pacman -S mingw-w64-i686-gcc mingw-w64-i686-glib2
pacman -S mingw-w64-i686-pango mingw-w64-i686-atk mingw-w64-i686-gtk3

then I run the following to build

PATH=$PATH:/c/Program\ Files\ \(x86\)/Mono/bin/
PATH=$PATH:/c/Program\ Files\ \(x86\)/Mono/lib/mono/4.5
PATH=$PATH:/c/Windows/Microsoft.NET/Framework/v4.0.30319/

cd /c/gtk-build/gtksharp/gtk-sharp
./autogen.sh
make

This leads to

Plug.cs(36,5): error CS1502: The best overloaded method match for 'Gtk.Plug.Construct(uint)' has some invalid arguments
Plug.cs(36,16): error CS1503: Argument 1: cannot convert from 'ulong' to 'uint'
Plug.cs(49,5): error CS1502: The best overloaded method match for 'Gtk.Plug.ConstructForDisplay(Gdk.Display, uint)' has some invalid arguments
Plug.cs(49,35): error CS1503: Argument 2: cannot convert from 'ulong' to 'uint'
make[3]: *** [Makefile:905: gtk-sharp.dll] Error 1
make[3]: Leaving directory '/c/gtk-build/gtksharp/gtk-sharp/gtk'
make[2]: *** [Makefile:604: all-recursive] Error 1
make[2]: Leaving directory '/c/gtk-build/gtksharp/gtk-sharp/gtk'
make[1]: *** [Makefile:446: all-recursive] Error 1
make[1]: Leaving directory '/c/gtk-build/gtksharp/gtk-sharp'
make: *** [Makefile:374: all] Error 2

I'm wondering if it might be because I'm using MSYS2, or perhaps because the csproj files seem to have missing files (I don't think they're auto generated when gapi-parser is run)

Hecatron commented 8 years ago

For the underlying gtk3 binaries I've managed to get these to build quite easily under windows using https://github.com/wingtk/gtk-win32 (I just had to modify the path for the perl location to strawberry perl's directory)

But the dll's generated by it lack the "lib" prefix (pango-1.0.dll instead of libpango-1.0.dll) probably because it's using msbuild instead of gcc

Considering there are interdependencies between the different dll's simply renaming them probably won't work do you have any ideas on a way around this? My thoughts are if I tried to modify the build process to use gcc within MSYS2 there then may be dependencies on the libc within MSYS2 which I'm trying to avoid

Hecatron commented 8 years ago

Closing this since I've now figured it out, I'll submit a merge request with a patch later on for Plug.cs along with updates to my blog for an easy way to build gtksharp