2

I have a src folder, containing a Main.hx & compile.hxml. I run the command sudo haxelib install nape, which reported it ended successfully installing Nape 2.0.5.

In the Main.hx I posted the code from this page, and then I run haxe compil.hxml which gave me the error: characters 0-22 : Class not found : nape.geom.Vec2. I can conclude haxe doesn't 'see' Nape.

Sidenote: I use ubuntu 12.10.

How do I use the library in my code?

mirandalol
  • 445
  • 1
  • 6
  • 16

3 Answers3

2

What does your .hxml look like?

you should have a line like '-lib nape' to link with the nape library.

On a different side note: Why are you running haxelib with sudo? It should not be necessary.

deltaluca
  • 1,642
  • 2
  • 10
  • 9
  • Not only should `sudo` not be necessary, but it may actually have unexpected results. It maybe install in a different location, or have the wrong permissions etc. – Adam Harte Apr 10 '13 at 01:11
  • You define lib location by yourself, so nothing unexpected here. – stroncium Apr 19 '13 at 08:49
2

If you are using openfl and got this same error then in project.xml

add this (as XML tag like the openfl one )


 &lthaxelib name="nape" />

Ivan Chernykh
  • 38,282
  • 12
  • 125
  • 141
Nafis Ahmad
  • 2,383
  • 1
  • 24
  • 13
0

I haven't used this library, but I know it was written in pre-macro times and used a special pre-processor for haxe, called caxe. Looking at github sources of the library I don't see much .hx files, mostly .cx. For example, there is nape/geom/Vec2.cx, but no nape/geom/Vec2.hx.

So, my assumption is the library should be precompiled first, probably by means of Makefile it comes packed with, however I wasn't able to find any documentation on the issue.

stroncium
  • 1,430
  • 9
  • 8
  • I don't expect anyone to be using the actual source code unless they're actively modifying it. The library is on haxelib with the already preprocessed source in .hx format. – deltaluca Apr 20 '13 at 22:52