473,587 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Drawin g
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.Drawin g
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 GtkSharpTutoria l {

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(s tring 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_f ilename);

/* 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.WriteLi ne("Hello again - cool button was pressed");
}

/* another callback */
static void delete_event(ob ject obj, DeleteEventArgs args)
{
Application.Qui t();
}

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

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

/* It's a good idea to do this for all windows */
window.DeleteEv ent += new DeleteEventHand ler(delete_even t);

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

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

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

/* 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(butt on);

window.ShowAll( );

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

--
W '04 <:> Open
Nov 22 '05 #1
2 3418
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
391
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 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...
2
3599
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 same space when drawn on the screen. I am working on a program that requires displaying data in fixed width font. I assumed that with...
1
1917
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 -r:System.Web -r:System.Web.Services -r:System.Drawing // using System;
3
3162
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 for the objects on the form, in addition the The objects are created in the fpositional class and affixed to the Input form through the fpositional...
21
5189
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 table and 11 sub items with data about each column. When a Row in ListView1 is selected the Data in ListVies2 is loaded to show the correct data....
0
1226
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: Compilation Error Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error. ...
3
2506
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 howto shows how to setup IronPython to use with Mono on Linux and how to rebuild IronPython from source. It also discusses various patches to...
6
1599
by: Twig | last post by:
Hi, Can I use strictly for C# development without missing anything from MS? Twig
5
6110
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: Value -8590321990885400808 is outside the valid range . Parameter name: ticks at System.DateTime..ctor (Int64 ticks) at...
4
9006
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 7.04 Feisty Fawn and Monodevelop 0.12 on a machine. So far so good, however I cannot compile and run a simplest winform application. Basically,...
0
7920
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.