1

I created some Modules from .Net dlls using cslibgen. Now I want to be able to use these modules in my haxe projects by using the import statement. For testing I used cslibgen on mscorlib.dll (to be able to use the system.Console class). Of course, when I make a project

Import system.Console;

Class HelloWorld
{
    public static function main():Void
    {
        Console.WriteLine("Hello World");
    }
}

It can't find System.Console. I wanted to add it to the HAXE_LIBRARY_PATH environment variable, but it didn't exist, and making one myself didn't fix it. So where should I add the path (or copy the modules) to be able to use them? (btw. If I copy the Console module to the project directory, I get the error that in console.hx the module system.Object (which it extends) can't be found, and copying ALL the dependencies into the project folder can't be the solution anyways.)

I'd apreaciate any help.

Fallere
  • 601
  • 4
  • 8

1 Answers1

1

Look at "using external library" here: https://github.com/HaxeFoundation/HaxeManual/wiki/Haxe-C%23 BTW:you don't need to import mscorelib haxe import this for you and you can use it like specified in http://api.haxe.org Btw: in haxe, if you export to cs (and using in cs specific api) of can't to export it to other targets..

Michael
  • 896
  • 10
  • 28
  • I didn't think that haxe already had that much functionallity for c#. I don't mind about the target limitation that invokes. I just wanted to see if I could power a WPF (or at least WinForms/GTK#) programm with Haxe (compiled to c#) as backend, for which I'd need some system.Windows classes, which of course aren't in haxe by default. But that -net-lib option seems pretty handy to use. Thanks anyways. – Fallere Jun 07 '15 at 11:34
  • Yes, Haxe/c# it's still little immature but it's improve all the time! when I develop to this target I found the [Haxe irc](http://webchat.freenode.net/?channels=haxe) very helpful! – Michael Jun 08 '15 at 09:54