I’d like to use thx.core’s Set type in a hello-world program.
This is with a regular command line setup on Debian and using an hl.hxml file to target HashLink.
I found the library listed at https://lib.haxe.org/p/thx.core/.
I installed it in the usual way:
haxelib install thx.core, and see that it is indeed present in my ~/haxelib, albeit named with a comma (“thx,core”) rather than the dot which I expected (“thx.core”).
In my Main.hx, at the top I put
In my hl.hxml file I added the line:
When I run
haxe hl.hxml I get the error:
src/Main.hx:1: characters 8-20 : Type not found : thx.core.Set
Where am I going wrong?
The syntax to include a lib is
see Getting Started - Haxelib Documentation for more documentation on haxelib.
Thanks Valentin, but changing
-L thx.core to
-lib thx.core in my hl.hxml file doesn’t seem to affect anything (and I see from
haxe --help that it looks like the newer usage is
-L|--library, rather than
It should be
Ah! Thanks, Andy. I was just looking into ~/haxelib/thx,core/0,43,0/src noticing that there’s a thx/Set.hx rather than thx/core/Set.hx file…
So, I changed my Main.hx to say,
import thx.Set;, and … I get other errors; though at least it looks like they’re errors from the library. I’m following the thx.Docs, but
var set = Set.create();
src/Main.hx:5: characters 19-29 : thx.Set has no field create
var s : Set<Int> = [1, 2, 3, 1];
src/Main.hx:5: characters 9-41 : Array<Int> should be thx.Set<Int>
Oh, whoops. I was looking at thx.core instead of thx.Set - thx libraries . I see that
Set.createInt() works. Thanks!