[Mono-list] Gtk demo in win32, prj2make#, IL

Malcolm Schonfield mschonfield@virtutis.com
Thu, 3 Mar 2005 15:35:22 +0100


On a windows 2000 machine I've installed mono 1.1.4, and I've been =
looking at the gtk# demo app bundled with the release. I've created a =
Visual Studio project with all the .cs files and the right references (I =
think!). I can send on the csproj file. It compiled easily under Visual =
Studio 2003 which is niceI had problems getting it to run, using the =
microsoft .NET framework (1.1). First I was getting dll problems, I =
think it was libgtk-win32-2.0-0.dll not being found. A post I found in a =
mono list led me to installing the "gtk runtime for windows", I used =
gtksharp-runtime-1.9.2-win32-0.3.exe. This resolved the dll problem. =
Then an unresolved problem loading Pixbufs, the app hangs at line 141 of =
DemoMain.cs :
	Gdk.Pixbuf pixbuf =3D Gdk.Pixbuf.LoadFromResource ("gtk-logo-rgb.gif"); =
The message is:

"Une exception non g=E9r=E9e du type 'System.ArgumentException' s'est =
produite dans gdk-sharp.dll

Informations suppl=E9mentaires=A0: resource must be a valid resource =
name of 'assembly'."

Yes it's in French, sorry. Now I've tried a couple of things, but no =
-Tried changing BuildAction on the image files
                    RelPath =3D "images\gtk-logo-rgb.gif"
                    BuildAction =3D "EmbeddedResource"
                    RelPath =3D "images\gtk-logo-rgb.gif"
                    BuildAction =3D "Content"
-Tried making a satellite assembly using the MS tool reseditor, =
containing the images, tried using assembly linker tool al.exe... Maybe =
I'm not going about it right.
-Tried looking at mono Doc : =

So my question is how do I get LoadFromResource to work?
Actually I have put the line in comments and without using =
LoadFromResource the app runs fine under windows .NET

Also I have a comment, I was interested in prj2make# but it took me a =
very long while to figure out the following syntax (might help someone):
>call C:\PROGRA~1\MONO-1~1.4\bin\setmonopath.bat
>nmake /f MakefileMcsWin32
I ended up having to copy 5 dlls {"x-sharp", x in {gtk, gdk, pango, atk, =
glib}} to the root directory of the app.

I'm very impressed that I can compile it with visual studio and then run =
it "mono GtkDemo.exe", even though there do seem to be more bugs in my =
VS-compiled version of the demo than in the bundled one.

How come mono IL and windows IL are so similar? Could anyone explain (or =
give links) about the differences between the IL generated by mcs and =
that generated by csc? Should we expect 100% interopability?


Malcolm Schonfield