PDA

View Full Version : monodevelop problem


eschi
2006-07-28, 07:26 AM CDT
Hello.

I successfully installed monodevelop from the mono repo:

[mono]
name=Mono for fedora-5-x86_64 (stable)
baseurl=http://go-mono.com/download-stable/fedora-5-x86_64/
enabled=1
gpgcheck=0


I can run run monodevelop and I also can build a smple console application in C#.

But when I try do build a simple Gnome# application, I get the errors:

[Task:File=/home/dirk/projects/test2/MyProgram.cs, Line=2, Column=1, Type=Error, Description=The type or namespace name `Gtk' could not be found. Are you missing a using directive or an assembly reference?(CS0246)

All references are in the project.

Can someone please help me. Do I need to set some enviroment variables, so the compiler knows where to search for the libraries?

I'm using Fedora Cor 5 on an AMD X2 3800+

Thanks in advance,
Dirk

Jman
2006-07-28, 10:38 PM CDT
You possibly need to yum install gtk-sharp2 or something, due to Gtk.

I'm working with Extras on a Fedora monodevelop package, hopefully that'll be better.

eschi
2006-07-29, 06:07 AM CDT
You possibly need to yum install gtk-sharp2 or something, due to Gtk.

I'm working with Extras on a Fedora monodevelop package, hopefully that'll be better.


My installed packages (from Novell) are:

Installed Packages
art-sharp2.x86_64 2.8.2-0.fedora5.novell installed
boo.noarch 0.7.0.1921-1.novell installed
bytefx-data-mysql.x86_64 1.1.13.8-0.novell installed
gconf-sharp2.x86_64 2.8.2-0.fedora5.novell installed
glade-sharp2.x86_64 2.8.2-0.fedora5.novell installed
glib-sharp2.x86_64 2.8.2-0.fedora5.novell installed
gnome-sharp2.x86_64 2.8.2-0.fedora5.novell installed
gnome-vfs-sharp2.x86_64 2.8.2-0.fedora5.novell installed
gtk-sharp2.x86_64 2.8.2-0.fedora5.novell installed
gtkhtml-sharp2.x86_64 2.8.2-0.fedora5.novell installed
gtksourceview-sharp2.noarch 0.10-3.novell installed
ikvm.noarch 1:0.22-0.novell installed
mono-core.x86_64 1.1.13.8-0.novell installed
mono-data.x86_64 1.1.13.8-0.novell installed
mono-data-oracle.x86_64 1.1.13.8-0.novell installed
mono-data-postgresql.x86_64 1.1.13.8-0.novell installed
mono-data-sqlite.x86_64 1.1.13.8-0.novell installed
mono-data-sybase.x86_64 1.1.13.8-0.novell installed
mono-nunit.x86_64 1.1.13.8-0.novell installed
mono-web.x86_64 1.1.13.8-0.novell installed
mono-winforms.x86_64 1.1.13.8-0.novell installed
monodevelop.noarch 0.9-2.novell installed
monodoc-core.noarch 1.1.13-1.novell installed


Any ideas?

LLS
2006-07-29, 02:43 PM CDT
I am trying to find some resolution on this myself only to run into many dead ends on forums around the web. I hate to see a good tool like this go to waste because there are so many dead ends on fixes. I too am getting a can't find gtk lib path errors and the one you have posted above. Will keep looking as it either works or it does not and I can not get anyone to say.

LLS
2006-07-29, 08:24 PM CDT
A little different error here now when using "test2.cs is your example code"
$ mcs -pkg:gtk-sharp test2.cs
test2.cs(9,5): error CS0246: The type or namespace name `MyWindow' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 1 error(s), 0 warnings

Here is one that compiles and works with one warning using myWindow maybe it can give us a hint at what is wrong with the first code.
using System;
using Gtk;

class VBoxTester {

static void Main ()
{
Application.Init ();
Window myWindow = new Window ("VBox Widget");

VBox myBox = new VBox (false, 4);

//Add the box to a Window container
myWindow.Add (myBox);
myWindow.ShowAll ();
Application.Run ();
}

static void AddButton (VBox box)
{
box.PackStart (new Button ("Button"), true, false, 0);
}
}

This one works a little better
using System;
using Gtk;

class WindowTester {
static void Main ()
{
Application.Init ();
Window myWindow = new Window ("This is a window");
myWindow.DeleteEvent += OnDelete;
myWindow.SetDefaultSize (200, 200);

//Put a button in the Window
Button button = new Button ("Click");
myWindow.Add (button);
myWindow.ShowAll ();
Application.Run ();
}

static void OnDelete (object o, DeleteEventArgs e)
{
Application.Quit ();
}
}

eschi
2006-07-30, 11:24 AM CDT
I compiled your example and get the following error:

mcs -pkg:gtk-sharp Main.cs
Package gtk-sharp was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk-sharp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk-sharp' found
error CS8027: Error running pkg-config. Check the above output.

A find for that file doesn't find the file: gtk-sharp.pc.

So, I'm really missing that one. But I thought everything is installed from the Novell repo.

Here is my PKG_CONFIG_PATH:

PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/mono:$PKG_CONFIG_PATH

LLS
2006-07-30, 04:35 PM CDT
I just have the stock fc5 and fc6test2 mono not the Novell version but my config path is /usr/lib/mono so that looks correct and I have not set a $PKG_CONFIG_PATH.

This is what ships with fc5 and 6--
$ ls /usr/lib/mono
1.0 compat-1.0 dbus-sharp gac gtk-sharp
2.0 compat-2.0 evolution-sharp gmime-sharp gtk-sharp-2.0

yum search mono--
and this is what is installed--
mono-core.i386 1.1.16-1.1 installed
gsf-sharp.i386 0.8-1.1 installed
mono-data-sqlite.i386 1.1.16-1.1 installed
dbus-sharp.i386 0.63-4.fc6 installed
gtk-sharp.i386 1.0.10-6.1 installed
mono-web.i386 1.1.16-1.1 installed
cdda2wav.i386 8:2.01.01.0.a10-1.1 installed
gmime-sharp.i386 2.2.1-2.1 installed
libgdiplus.i386 1.1.16-1.1 installed
evolution-sharp.i386 0.11.1-5.1 installed
gtk-sharp2.i386 2.8.2-2.1 installed
mono-data.i386 1.1.16-1.1 installed

LLS
2006-07-31, 09:07 PM CDT
I have tried setting pkg_config_path and as mono_config and it does no good. I was able to compile this file example with two warns but it runs, with this -mcs -pkg:gtk-sharp-2.0 -r:System.Drawing box1.cs
all my my .pcs are in /usr/lib/pkgconfig but dlls are in /usr/lib/mono/. Works fine in fc5 but not so well in fc6t2.
http://www.mono-project.com/GtkSharp:_Packing_with_Boxes

eschi
2006-08-01, 10:29 AM CDT
Hi. sorry for waiting so long for my reply.

When I do a mcs -pkg:gtk-sharp-2.0 -r:System.Drawing box1.cs at the console, it works fine. I get these three warnings:

box1.cs(18,29): warning CS0219: The variable `box1' is assigned but its value is never used
box1.cs(74,30): warning CS0219: The variable `misc' is assigned but its value is never used
box1.cs(62,29): warning CS0169: The private method `GtkSharpTutorial.fixedcontainer.exitbutton_event( object, Gtk.ButtonPressEventArgs)' is never used
Compilation succeeded - 3 warning(s)

So, do I understand you the right way, that you don't use monodevelop? Just only the comand line?

LLS
2006-08-01, 10:35 AM CDT
Yes, this is new to me so I am just learning about the utilities so then I would mono box1.exe 1 or box1.exe 2 or box1.exe 3 and view the output.

eschi
2006-08-01, 10:39 AM CDT
Hey, this was pretty fast;-)

Well,

mono box1.exe 1

worked well. The window with the buttons appear on the screen.

raphtee
2006-11-04, 12:44 PM CST
You need to installl gtk-sharp2-devel via yum

raphtee