473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

mono doesn't find System.Drawing


When I try to compile my GTK# app, the compiler says:

jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -r -o
buttons.exe
error CS2001: Source file 'buttons.exe' could not be opened
Compilation failed: 1 error(s), 0 warnings
jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -o
buttons.exe
buttons.cs(8) error CS0246: The namespace `System.Drawing' can not be found
(missing assembly reference?)
Try using -r:System.Drawing
Compilation failed: 1 error(s), 0 warnings
jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -o
buttons.exe -r:System.Drawing
error CS0006: Cannot find assembly `System.Drawing'
Log:

Compilation failed: 1 error(s), 0 warnings
jbailo@linux:~/mono>

here's the source code:

//buttons.cs

namespace GtkSharpTutorial {

using Gtk;
using GtkSharp;
using System;
using System.Drawing;

public class buttons
{
/* Create a new hbox with an image and a label packed into it
* and return the box. */

static Widget xpm_label_box(string xpm_filename, string label_text )
{

/* create box for image and label */
HBox box = new HBox(false, 0);
box.BorderWidth = 2;

/* Now on to the image stuff */
Gtk.Image image = new Gtk.Image(xpm_filename);

/* Create a label for the button */
Label label = new Label (label_text);

/* Pack the image and label into the box */
box.PackStart( image, false, false, 3);
box.PackStart( label, false, false, 3);

image.Show();
label.Show();

return box;
}

/* Our usual callback function */
static void callback( object obj, EventArgs args)
{
Console.WriteLine("Hello again - cool button was pressed");
}

/* another callback */
static void delete_event(object obj, DeleteEventArgs args)
{
Application.Quit();
}

public static void Main(string[] args)
{
Application.Init();

/* Create a new window */
Window window = new Window ("Pixmap'd Buttons!");

/* It's a good idea to do this for all windows */
window.DeleteEvent += new DeleteEventHandler(delete_event);

/* Sets the border width of the window */
window.BorderWidth = 10;

/* Create a new button */
Button button = new Button();

/* Connect the "clicked" signal of the button on your callback */
button.Clicked += new EventHandler(callback);

/* This calls our box creating function */
Widget box = xpm_label_box("info.xpm", "cool button");

/* Pack and show all our widgets */
box.Show();

button.Add(box);

button.Show();

window.Add(button);

window.ShowAll();

/* Rest in gtk_main and wait for the fun to begin! */
Application.Run();
}
}
}

--
W '04 <:> Open
Nov 22 '05 #1
2 3389
Hi Bailo, a.k.a. James Coburn's Grey Helmet Hair,
Re: Your:
error CS2001: Source file 'buttons.exe' could not be opened

What errors come up when you do a:
mcs buttons.cs -o buttons.exe ?

Look up the documentation for the stuff that pops up
it should tell you what .LIB files you need to link with
as well as what include files you'll need.

You might have to provide the path to the .LIB file too.
Nov 22 '05 #2
Jeff Relf wrote:
Hi Bailo, a.k.a. James Coburn's Grey Helmet Hair,
Re: Your:
error CS2001: Source file 'buttons.exe' could not be opened

What errors come up when you do a:
mcs buttons.cs -o buttons.exe ?

Look up the documentation for the stuff that pops up
it should tell you what .LIB files you need to link with
as well as what include files you'll need.

You might have to provide the path to the .LIB file too.


Ignore that first one. It was malformed.

--
W '04 <:> Open
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James Coburn's Grey Helmet Hair | last post by:
When I try to compile my GTK# app, the compiler says: jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -r -o buttons.exe error CS2001: Source file 'buttons.exe' could not...
2
by: Stuart Norris | last post by:
Dear Group, I have a question about the result from ‘graphics.MeasureString' when using a mono-spaced font. Firstly I assume that Courier New font is mono-spaced, ie each character takes up the...
1
by: Paul C. | last post by:
I am new to programming in C# using Mono (mcs). What .dll does this "InitializeComponent()" method reside in? Code: // mcs web.cs -lib:C:\Program~1\Mono-1.0\lib -r:System.Data...
3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
0
by: frankgerlach | last post by:
When trying to run the sample web services of the mono distribution (file /opt/mono-1.1.10/lib/xsp/test/1.1/webservice/TestService.asmx), I get the following error message in my web browser: ...
3
by: Sanghyeon Seo | last post by:
I took some time to write this HOWTO: http://sparcs.kaist.ac.kr/~tinuviel/fepy/howto/simplehttpserver-ironpython-mono-howto.html IronPython seems to get much less interest than it deserves. This...
6
by: Twig | last post by:
Hi, Can I use strictly for C# development without missing anything from MS? Twig
5
by: Nikola Skoric | last post by:
I ran in Mono a program developed on .NET Framework 2.0 and it ran OK until I tried to desirialize a object. There the program died abruptly dumping this: System.ArgumentOutOfRangeException:...
4
by: Hitchkas | last post by:
I have a very beginner and fundamental question regarding porting and running C# programs in Linux. As a background I am a total idiot when it comes to Linux but somehow managed to install Ubuntu...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.