PATH problem?

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
DRCurran
Posts: 7
Joined: Mon Aug 11, 2014 10:36 pm

PATH problem?

Post by DRCurran » Tue Oct 21, 2014 10:32 pm

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

jussij
Site Admin
Posts: 2429
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Tue Oct 21, 2014 11:02 pm

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.

jussij
Site Admin
Posts: 2429
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Tue Oct 21, 2014 11:10 pm

From that tutorial link shows above it gives this form_mono.cs example :

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();
      }
   }
}
That code should compile to a GUI application using this command line:

Code: Select all

mcs –out:form_mono.exe –pkg:gtk-sharp form_mono.cs
If it does then it means that the GTK package is installed in the GAC.

DRCurran
Posts: 7
Joined: Mon Aug 11, 2014 10:36 pm

path/GAC

Post by DRCurran » Tue Oct 21, 2014 11:18 pm

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

jussij
Site Admin
Posts: 2429
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Tue Oct 21, 2014 11:21 pm

Out of curiosity did the the GUI sample that I posted above compile and run :?:

DRCurran
Posts: 7
Joined: Mon Aug 11, 2014 10:36 pm

Gac

Post by DRCurran » Tue Oct 21, 2014 11:52 pm

Hi-
Haven't tried the sample, but will. The Code Project article is very helpful.

Thank again,
Dan

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 5 guests