toLua++ for Mac

Attached is the toLua*+ binary for Mac.
The coco2d-x v1.0.1, I downloaded, did not have an executable for Mac and I had to go through the process of compiling toLua**, not that it was easy.
I have named it to toLua*+.exe, I know it is wrong but that makes it compatible with the current build.xml ant script. If anyone finds a better way to handle the file-naming in build.xml, then please post here.

Happy Coding :slight_smile:


tolua++.exe.zip (116.6 KB)

Awesome!
Thanks Haseeb!

Thank you Haseeb.

Since I cannot create new Issues I will write in here hoping that someone will raise a new issue in tracker.

Well there’s something wrong going on with toLua and cocos2d-x,
First of all there’s a pkg file missing in the zip:

cocos2d-x-bindings:
     [echo] Calling tolua++
     [exec] 
     [exec] ** tolua internal error: [string "tolua embedded: src/bin/lua/package.lua"]:274: #CCFileUtils.pkg: No such file or directory: CCFileUtils.pkg.
     [exec] 
     [exec] 
     [exec] stack traceback:
     [exec]     [string "tolua: embedded Lua code 23"]:6: in main chunk
     [echo] Patching resultant lua bindings

So I’ve commented out CCFileUtils.pkg in cocos2d.pkg file.
Now ant runs fine however… I get loads of errors when running app:

Warning:Warning:[WARN]warning: no rule to process file '$(PROJECT_DIR)/libs/lua/lua/Makefile' of type sourcecode.make for architecture i386
/Users/krystian/projects/ogsClient/libs/lua/cocos2dx_support/LuaCocos2d.cpp
    Error:Error:line (60)'CCObject' was not declared in this scope
    Error:Error:line (60)template argument 2 is invalid
    Error:Error:line (60)invalid type in declaration before '=' token
    Error:Error:line (60)'CCObject' cannot appear in a constant-expression
    Error:Error:line (60)template argument 2 is invalid
    Error:Error:line (60)expected primary-expression before ')' token
    Error:Error:line (60)expected ',' or ';' before 'tolua_tousertype'
    Error:Error:line (417)'CCObject' was not declared in this scope
    Error:Error:line (417)template argument 1 is invalid
[...]
    Information:Information:Showing first 200 errors only

So I’ve checked the original file and the new file and in the new file there’s using namespace cocos2d; missing.
Also, line with #include "LuaCocos2d.h" is duplicated [even in the zip file I’ve downloaded.

So I’ve added the namespace line and now it works fine.

Oh, thank you.
You can pull a request by github.

I just did that:

I have also included the tolua++.exe for mac from this thread.

Thank you.