473,322 Members | 1,718 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,322 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 3385
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.