Issues compiling Haxe on Mac

292 views
Skip to first unread message

Sam Crowley

unread,
Dec 23, 2015, 1:03:43 AM12/23/15
to Haxe
I've finally just set up HaxeFlixel on my Mac and have been using it in Sublime Text 2.

I have the Sublime Haxe Plug-In Bundle installed but when I try to run a program I get this error:

[Errno 2] No such file or directory
[cmd:  [u'haxelib', u'run', u'openfl', u'build', u'Project.xml', u'html5']]
[dir:  /Users/USERNAME/Downloads/FILENAME]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]

When I use this command in Terminal:

haxe -main /Users/USERNAME/.../source/Main.hx -swf test.swf


I am met with this error:

Error: Could not process argument /Users/USERNAME/.../source/Main.hx

empty part


I'm completely new to Haxe and don't have a clue what to do. Any ideas? Thanks :)

Cristian Baluta

unread,
Dec 23, 2015, 3:20:55 AM12/23/15
to haxe...@googlegroups.com
Are you on El Capitan? If yes this path is wrong, maybe the plugin is outdated. [path: /usr/bin:/bin:/usr/sbin:/sbin], should be usr/local/....
As for the second problem you're not supposed to add the .hx extension

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--
Message has been deleted

Sam Crowley

unread,
Dec 23, 2015, 3:51:44 AM12/23/15
to Haxe
I am on El Capitan but I'm sure the plugin is up to date as I just downloaded it today, is it possible to the change the path?

Also I tried running in terminal with 
haxe -main /Users/.../source/Main -swf test.wf 
So with the .hx removed, but I just got this error:

Error: Could not process argument /Users/.../source/Main


Class name must start with uppercase character


The class name is Main.hx. That's an uppercase, right?

Cristian Baluta

unread,
Dec 23, 2015, 4:00:21 AM12/23/15
to haxe...@googlegroups.com
I'm not sure if counts but try to run the command from within your project instead using absolute paths, so you'll type only -main Main. And make sure the class also begins with M not just the filename.

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Sam Crowley

unread,
Dec 23, 2015, 4:06:10 AM12/23/15
to Haxe
That seems to have worked but now I get this error:

Main.hx:3: characters 7-23 : Type not found : flixel.FlxSprite


Importing flixel.FlxSprite is the line it's referring to so I'm assuming this is an error with the libraries or installed files rather than a compile error. I'll try figure it out but do you have any ideas?


Thanks for the help :)

Rafael Oliveira

unread,
Dec 23, 2015, 7:50:17 AM12/23/15
to Haxe
Would be good if you use sublime text 3, I saw a person having a issue on st2 (the code completion not working)

Rafael Oliveira

unread,
Dec 23, 2015, 8:11:02 AM12/23/15
to Haxe
Openfl apps should be compiled with: openfl test flash, or haxelib run openfl test flash
make sure the commands haxe and haxelib are working on terminal.

clemos

unread,
Dec 23, 2015, 8:16:14 AM12/23/15
to haxe...@googlegroups.com
Hi,

I think you need to add "-lib flixel" to your compilation command.

Regarding Sublime Text, but also more generally, it's usually better to use .hxml files for compilation.
For example, you could create a "build.hxml" file containing :
-main Main
-cp path/to/your/files
-lib flixel
-swf test.swf

and then run it with just "haxe build.hxml"

.hxml files are not only convenient to save your compilation params, but they will also help the Sublime Text bundle work better.

Best,
Clément


--

Sam Crowley

unread,
Dec 23, 2015, 6:12:27 PM12/23/15
to Haxe
So I tried the `build.hmxl` file and it seems to get further than before, but now I get this error:

/Users/USERNAME/~/haxelib/openfl/3,5,3/openfl/display/IBitmapDrawable.hx:17: characters 8-66 : Type not found : RenderSession


Does this mean there's a problem with my OpenFL installation?

Cristian Baluta

unread,
Dec 24, 2015, 11:38:49 AM12/24/15
to haxe...@googlegroups.com
there's really no working sample for you to try? It is not necessarily bad but haxelibs are found in /usr not /Users

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages