# Haxe Lua target: dependencies

**URL:** https://community.haxe.org/t/haxe-lua-target-dependencies/2166
**Category:** Haxe
**Tags:** haxe-lua
**Created:** [December 1, 2019, 4:57pm UTC](https://community.haxe.org/t/haxe-lua-target-dependencies/2166 "2019-12-01T16:57:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![stetso](https://avatars.discourse-cdn.com/v2/letter/s/ba8739/32.png) [@stetso](https://community.haxe.org/u/stetso)
#### Post date: [December 1, 2019, 4:57pm UTC](https://community.haxe.org/t/haxe-lua-target-dependencies/2166/1 "2019-12-01T16:57:09Z")

</div>

Hello everyone,

I am relatively new to the Haxe world but I enjoy the language a lot so far. Currently I am investigating the possibility to create externs for the [Gideros Game Framework](https://wiki.giderosmobile.com/index.php/Welcome!) which uses Lua and - I think - would fit quite nicely with a Haxe-based development workflow. However, I have trouble getting even a short test to work. The main problem seems to be with the dependencies necessary.

Compiling a very simple Haxe script to Lua:

```haxe
class Game {
	static public function main() {
		trace('Hello World');
	}
}

```

with the build.hxml:

```haxe
-cp src
-lua main.lua
-main Game

```

does indeed create a potentially good-looking main.lua. However, it seems to require a few dependencies (as detailed in the manual) that need to be installed using luarocks. As Gideros is mainly its own platform unaware of luarocks, running the script fails with: `main.lua:53: module 'lua-utf8' not found`.

What options do I have now? Is it possible to somehow exclude the lua-utf8 dependency from the compilation or do I need to get Gideros to satisfy it (by either including it or making it aware of the luarocks folder)? Or am I missing something? I tried to get inspiration from the [hxdefold](https://github.com/hxdefold/hxdefold) project but can’t find anything related to my problem. How did they solve that (maybe Defold includes all dependencies already?).

Thanks a lot and again: Haxe is pretty great, I enjoy it a lot more than Typescript which I normally use, so it is a pity it is not more popular. Great work!

---

<div class="post-metadata">

### Author: ![PXshadow](https://community.haxe.org/user_avatar/community.haxe.org/pxshadow/32/907_2.png) [@PXshadow](https://community.haxe.org/u/PXshadow)
#### Post date: [December 1, 2019, 6:20pm UTC](https://community.haxe.org/t/haxe-lua-target-dependencies/2166/2 "2019-12-01T18:20:47Z")

</div>

Try this build command.

```haxe
-D lua-vanilla

```

---

<div class="post-metadata">

### Author: ![stetso](https://avatars.discourse-cdn.com/v2/letter/s/ba8739/32.png) [@stetso](https://community.haxe.org/u/stetso)
#### Post date: [December 1, 2019, 6:37pm UTC](https://community.haxe.org/t/haxe-lua-target-dependencies/2166/3 "2019-12-01T18:37:35Z")

</div>

It seems to work! Awesome, thanks.

Is that command documented somewhere? Maybe there are others that prevent future questions from my side… 😉

---

<div class="post-metadata">

### Author: ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)
#### Post date: [December 1, 2019, 6:46pm UTC](https://community.haxe.org/t/haxe-lua-target-dependencies/2166/4 "2019-12-01T18:46:57Z")

</div>

You can find it in the lua section of the manual [Version flags - Haxe - The Cross-platform Toolkit](https://haxe.org/manual/target-lua-flags.html)

---

<div class="post-metadata">

### Author: ![stetso](https://avatars.discourse-cdn.com/v2/letter/s/ba8739/32.png) [@stetso](https://community.haxe.org/u/stetso)
#### Post date: [December 1, 2019, 7:33pm UTC](https://community.haxe.org/t/haxe-lua-target-dependencies/2166/5 "2019-12-01T19:33:14Z")

</div>

Alright, not well hidden… I somehow missed it. Thanks!

---

<div class="post-metadata">

### Author: ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)
#### Post date: [December 1, 2019, 7:36pm UTC](https://community.haxe.org/t/haxe-lua-target-dependencies/2166/6 "2019-12-01T19:36:00Z")

</div>

There are a bunch of other not lua-specific flags, which you may find useful: [Global Compiler Flags - Haxe - The Cross-platform Toolkit](https://haxe.org/manual/compiler-usage-flags.html)
