PDA

View Full Version : Mono, GTK# and Oxygene Command Line



Mr. Hania
25-02-2009, 05:18 AM
Hi there, new PGD looks great!

I'm trying to get started with Oxygene. However, I don't like .NET so I installed Mono framework. There (http://prismwiki.codegear.com/en/Compiling_for_Mono) is wrote something about compiling for Mono. And everything works fine with {MONOFRAMEWORK}. But, I need GTK# so I want replace {MONOFRAMEWORK} to {MONO} to get this. And... The compiler starts crying:

Unable to load assembly C:\(...)\mscorlib.dll
So, the question is: how to use GTK# with Mono and Oxygene? Delphi Prism wiki is wrong...?





And theres a bonus question! List, stack and queues are in the same unit, I am right? So, why I can't use stacks and queues?

var lista := new list <integer>; //OK
var stos := new stack <integer>; //ERROR
var kolejka := new queue <integer>; //ERROR



Thanks for help.

noeska
25-02-2009, 09:06 PM
What is the difference between {MONOFRAMEWORK} and {MONO} ? Arent they the same?
Also changing the framework with ms works like this:

Oxygene MyForm.pas /assemblyname:MyForm /type:winexe /frameworkfolder:C:\WINDOWS\Microsoft.NET\FrameWork \v2.0.50727 /ref:$(Framework)\System.Windows.Forms.dll /ref:$(Framework)\System.Drawing.dll /ref:$(FrameWork)\System.dll

So with /frameworkfolder you tell the compiler what framework you want to use. Next /ref:$(FrameWork)\System.dll uses that path.

Mr. Hania
26-02-2009, 04:54 AM
Yep, I know about -frameworkfolder. I'm typing something like this:

oxygene -frameworkfolder:{MONOFRAMEWORK} a.pas
What's the diffrenece between {MONOFRAMEWORK} and {MONO}? Delphi Prism Wiki says that with {MONOFRAMEWORK} I can use only Mono, with {MONO} I can use GTK# and other units.

noeska
26-02-2009, 05:37 PM
This should exaplain it: http://prismwiki.codegear.com/en/Compiling_for_Mono
so {MONO}\2.0\ should be equal to {MONOFRAMEWORK} so i think you should include \2.0\ to some of your references.
Also you may need to use mono oxygene instead of oxygene if you also have the microsoft .net installed.

Mr. Hania
26-02-2009, 09:15 PM
Ha, thanks for help! I'm new in "command line compiling" so, I just put "oxygene -frameworkfolder:{MONO}" and I was thinking that it will add all *.dll's in all subfolders! When I added "-ref:{MON}\gtk(...)" with all needed *.dll's everything works fine :)

However, question about stack and queues is still alive :(

noeska
27-02-2009, 04:32 PM
Loose the new keyword? The source you posted looks like vb to me? Try to find some c# source and translate that with babelcode ( http://lingua.codegear.com/babelcode/client/BabelClient.aspx ). You cannot trust it always but 90% it provides correct delphi code.

Mr. Hania
01-03-2009, 08:13 AM
I'm declaring it correctly - I'm sure 'bout that. Look at Wikipedia examples:
http://en.wikipedia.org/wiki/Oxygene_(programming_language)

Now look here:http://msdn.microsoft.com/en-us/library/system.collections.generic.aspx
List, stack and queue are in the same unit. The declaration of it is the same too (the diffrence is in name of course). If this

var l := new list <integer>;

compile fine, why this cannot?:

var l := new stack {or queue} <integer>;

Mr. Hania
26-06-2009, 10:45 AM
Hi again. To include all of the GTK# libaries in C# compiler, I simply put that to compile:

mcs -pkg:gtk-sharp-2.0 name.cs

To include the same libaries in Oxygene I have to write this horrible command:

oxygene -frameworkfolder:{MONOFRAMEWORK} -ref:{MONO}\gtk-sharp-2.0\gtk-sharp.dll -ref:{MONO}\gtk-sharp-2.0\glib-sharp.dll name.pas
And that's for only basic GTK# options. Is there anyway to cut some characters from it? If not - it suck...