1

I want to simply create a reusable "library" for all my future projects that I'm going to be doing in Haxe. I understand there aren't library projects in Haxe, but rather you would just have a collection of source files somewhere and import them as needed. Right?

I've created a new project using Flambe (a Haxe framework) and opened it in the FlashDevelop IDE. It compiles and runs fine.

Now I want to include my library, so I go into the Project Properties under the "Classpaths" tab and set the relative path to my library. It shows up correctly in the "References", and even has the proper code completion when I type "import ...", yet when I compile it fails on the import line stating: 'Class not found : mlg.Engine'

(mlg being the package, and Engine being the class/type)


Is there anything I'm missing?

Mark Knol
  • 9,663
  • 3
  • 29
  • 44
Game_Overture
  • 1,578
  • 3
  • 22
  • 34

1 Answers1

4

I think (i may be wrong) that flashdevelop "references" are just autocompletion and not actually passed to the compiler.

I'm not sure what's the "right" way to do it, but I can tell you what I've done (I made a few helper classes for flambe too :P): I simply created a "fake" haxelib, I created HaxeToolkit/haxe/lib/[name]/git, and in [name] i created a .current file that contains "git".

Then on flashdevelop you have to add it as a library (Project settings -> Compiler options -> Libraries).

Note: there are probably other/better ways to do it.

npretto
  • 1,098
  • 7
  • 18
  • 2
    I use the fake haxelib thing too... though a little differently. I use "haxelib dev mylibrary "/path/to/mylib/src", and then use "-lib mylibrary" when compiling (or from FlashDevelop). – Jason O'Neil Feb 14 '14 at 23:58
  • I was hoping I didn't have to do the whole haxelib thing as I'm not familiar with it, plus it assumes it's open source licence which my project isn't. But it sounds like I can fake it and it'll work. Thanks for the info. (I'll also try Jason's way) – Game_Overture Feb 17 '14 at 18:11
  • you don't have to publish it as opensource if you want to use my orJason's way – npretto Feb 17 '14 at 21:48