Hi-
Apparently I'm still having path problems. I've tried to compile Mono demo files and keep getting the following error-
error CS0246: The type or namespace name `Gtk' could not be found. Are you missing an assembly reference?
With the same messages for the classes in Gtk. I've explicitly placed the directories involved with these classes in the PATH statement to no avail. The compiler is finding the .Net using System reference, however.
Is there a different approach to make a reference to these assemblies?
Thanks again for your help,
Dan
PATH problem?
Is there a different approach to make a reference to these assemblies?
Yes indeed it does. The .Net framework does not use the PATH but instead it uses a thing call the GAC.
I suspect the error you are seeing relates to the fact that the GTK package referenced in the error is not installed and hence it is missing from the GAC.
I came across the link below which does a good job of describing how to use Mono on Windows:
http://www.codeproject.com/Articles/134 ... -framework
Halfway through that tutorial there are also details on how to install the GTK package into the GAC.
From that tutorial link shows above it gives this form_mono.cs example :
That code should compile to a GUI application using this command line:
If it does then it means that the GTK package is installed in the GAC.
Code: Select all
using System;
using Gtk;
using GtkSharp;
namespace FirstDialogMONOApp{
public class form_mono{
private static Label lbl;
static void onWindowDelete(
object obj, DeleteEventArgs args){
Application.Quit();
}
static void onBtnClick(object obj, EventArgs args){
lbl.Text = "Hello to you!";
}
static void Main() {
Application.Init();
Window win = new Window("First Form - mono");
win.DeleteEvent+=
new DeleteEventHandler(onWindowDelete);
VBox vbox = new VBox(false,1);
lbl = new Label("???");
vbox.PackStart(lbl,false,false,1);
Button btn = new Button ("Say Hello");
btn.Clicked+=new EventHandler(onBtnClick);
vbox.PackStart(btn,true,true,1);
win.Add(vbox);
win.ShowAll();
Application.Run();
}
}
}
Code: Select all
mcs –out:form_mono.exe –pkg:gtk-sharp form_mono.cs
path/GAC
Hi-
I was just looking on Wikipedia at GAC. I have an older Mono manual that mentioned that. Since your reference specifically deals with Mono that should help. Hopefully, between the references I can get past this and actually get some coding done!
Thanks once more for your help,
Dan
I was just looking on Wikipedia at GAC. I have an older Mono manual that mentioned that. Since your reference specifically deals with Mono that should help. Hopefully, between the references I can get past this and actually get some coding done!
Thanks once more for your help,
Dan