Prev | Current Page 293 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

It is possible to add
references from the current project to others using the switch - cp (class path) followed by the path to the
directory containing the code to include. The - cp switch can be repeated more than once with different
paths. The imported libraries will be treated as residents in the main directory of the current project.
Supposing that you have a library containing some useful classes in d:\lib\utilities , you can
import them at compile time using the class path switch in the following way:
haxe -cp d:\lib\utilities -neko out.n -main Main
This command compiles the Main class contained in the current working directory; the Main class can
also access the types defined in the files contained in the utilities directory using the already explained
import notation.
External Libraries
Sometimes it will be necessary to use third - party libraries that are not available in haXe code but just as
compiled resources (in the JavaScript case a real compilation does not exist; haXe translates its own code
into another syntax and adds a small API to even the differences between the two).


Pages:
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305