Search code examples
importpathhaxehaxelib

Haxe add own Modules to path


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.


Solution

  • 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..