Aurel300/ammer

ammer_adder.hl.c:2:10: fatal error: hl.h: No such file or directory -- Linux

Closed this issue · 3 comments

I'm having problems with hl.h on Linux...

> haxe -D ammer.hl.hlInclude=/home/jward/dev/hashlink/src -D ammer.hl.hlLibrary=/home/jward/dev/hashlink/ build-hl.hxml
make: Entering directory '/home/jward/dev/ammer/samples/poc/bin/hl'
cc  -fPIC -o ammer_adder.hl.o -c ammer_adder.hl.c -I /home/jward/dev/ammer/samples/poc/native
ammer_adder.hl.c:2:10: fatal error: hl.h: No such file or directory
 #include <hl.h>
          ^~~~~~
compilation terminated.
Makefile.hl.ammer:8: recipe for target 'ammer_adder.hl.o' failed
make: *** [ammer_adder.hl.o] Error 1
make: Leaving directory '/home/jward/dev/ammer/samples/poc/bin/hl'

It appears that the Makefile.hl.ammer does not include my reference to the hl include directory:

> cat bin/hl/Makefile.hl.ammer
all: ammer_adder.hdll
	@:

ammer_adder.hdll: ammer_adder.hl.o
	$(CC) $(CFLAGS) -I /home/jward/dev/ammer/samples/poc/native -D LIBHL_EXPORTS -m64 -shared -o ammer_adder.hdll ammer_adder.hl.o -L/home/jward/dev/hashlink/ -lhl -L/home/jward/dev/ammer/samples/poc/native -ladder

ammer_adder.hl.o: ammer_adder.hl.c
	$(CC) $(CFLAGS) -fPIC -o ammer_adder.hl.o -c ammer_adder.hl.c -I /home/jward/dev/ammer/samples/poc/native

.PHONY: all

Looks like it's dying becuase these lines do not reference the path to hl.h, correct? -- https://github.com/Aurel300/ammer/blob/master/src/ammer/build/BuildHl.hx#L40-L43

You're right :)

Awesome, it works now, thanks!

> haxe -D ammer.hl.hlInclude=/home/jward/dev/hashlink/src -D ammer.hl.hlLibrary=/home/jward/dev/hashlink/ build-hl.hxml
make: Entering directory '/home/jward/dev/ammer/samples/poc/bin/hl'
cc  -fPIC -o ammer_adder.hl.o -c ammer_adder.hl.c -I /home/jward/dev/ammer/samples/poc/native -I /home/jward/dev/hashlink/src
cc  -I /home/jward/dev/ammer/samples/poc/native -D LIBHL_EXPORTS -m64 -shared -o ammer_adder.hdll ammer_adder.hl.o -L/home/jward/dev/hashlink/ -lhl -L/home/jward/dev/ammer/samples/poc/native -ladder
make: Leaving directory '/home/jward/dev/ammer/samples/poc/bin/hl'

And execute:

> cp dummy.txt bin/hl
> cd bin/hl
> LD_LIBRARY_PATH=~/dev/hashlink:../../native/ ~/dev/hashlink/hl sample.hl 
Main.hx:3: 3 + 9 = 12
Main.hx:4: foo + bar = foobar
Main.hx:5: read("dummy.txt") = hello world!
and a Unicode cow: 🐄

Main.hx:6: reverse_bytes("hello") = olleh