How to let LUA_FUNCTION attach with toluafix_ref_function

I defined the pkg file with

void registerFunctionOnClick(LUA_FUNCTION fun);

but in the generated cpp, it shows

LUA_FUNCTION funcID = * ((LUA_FUNCTION*) tolua_tousertype(tolua_S,2,0));

not what I want it to be
LUA_FUNCTION funcID funcID = ( toluafix_ref_function(tolua_S,2,0) );

what would I do?
thank u for replies

See: http://www.cocos2d-x.org/boards/11/topics/13736

You need to use build.php, it rewrites some stuff.

Simon - wrote:

See: http://www.cocos2d-x.org/boards/11/topics/13736
>
You need to use build.php, it rewrites some stuff.

Thank you.
But I don’t know how to use build.php…
I have no idea about php,so can you show me something?

No problem.

The file is located in tools\tolua**.php
If you read it, it might become apparent to you it just replaces some strings in the .cpp file that it generates with tolua**. For example:
*((LUA_FUNCTION*) is replaced by (

You might want to do the same thing, at the very least you have to be aware that the output that tolua++ generates is not perfect, so you will have to tweak it a bit before things like passing function handlers from lua becomes possible.

Simon - wrote:

No problem.
>
The file is located in tools oluauild.php
If you read it, it might become apparent to you it just replaces some strings in the .cpp file that it generates with tolua
. For example:
*((LUA_FUNCTION*) is replaced by (
>
You might want to do the same thing, at the very least you have to be aware that the output that tolua*+ generates is not perfect, so you will have to tweak it a bit before things like passing function handlers from lua becomes possible.
yes, yes, I think I konw what you mean.
But I still don’t konw how to executive build.php to replace what I want.
It reads in build.php:
HOW TO USE:
$cd cocos2d-x/tools/tolua*+
$ php build.php

I did this in cmd, but it didn’t work

I appreciate your replies. Thanks a lot

Ah, that’s easy, you need to install php on your system first.
On windows, use: http://windows.php.net/downloads/releases/php-5.3.20-Win32-VC9-x86.msi

On other operating systems, google “install php YOUR_OPERATING_SYSTEM_HERE” for instructions.

Simon - wrote:

Ah, that’s easy, you need to install php on your system first.
On windows, use: http://windows.php.net/downloads/releases/php-5.3.20-Win32-VC9-x86.msi
>
On other operating systems, google “install php YOUR_OPERATING_SYSTEM_HERE” for instructions.

Thank you, Simon. You helped me a lot.
I generated what I want.