print() does noting in lua code

Hello,

I am using Windows 7 and I downloaded the new version for cocos2d-x (2.1.3) and built it. Now I can’t get the print() -function to do anything in my lua code, it does not work on any of the sample projects either. Using printf() in the c++ side of things still works and it’s output goes to the console window as expected.

I haven’t the slightest clue where to begin to look for a solution to this problem, could someone point me to the right direction?

It had to do with the switch to have print() implemented using the CCLOG -macro, which does nothing if COCOS2D_DEBUG=1 is not defined. COCOS2D_DEBUG=1 is set in the preprocessor definitions by default when you make a new multiplatform project like I did, but it is NOT defined in the “liblua” project! Since print() is implemented in liblua’s “LuaStack.cpp” file, and uses CCLOG, it won’t do anything.

So I added COCOS2D_DEBUG=1 to liblua’s preprocessor definitions and it works fine now.

COCOS2D_DEBUG=1 to liblua’s preprocessor is work.
Thank you Sami Peltomaa.

Sami Peltomaa wrote:

So I added COCOS2D_DEBUG=1 to liblua’s preprocessor definitions and it works fine now.

Could you describe it more? I do not understand what you mean

Open liblua Property Pages ,and choose Configuration Properties—c/c++—-Preprocessor,in Preprocessor Definitions item,you can add COCOS2D_DEBUG

Just changed function in log.lua to CCLuaLog() and it’s star to work

@Elu wrote:

It had to do with the switch to have print() implemented using the CCLOG -macro, which does nothing if COCOS2D_DEBUG=1 is not defined. COCOS2D_DEBUG=1 is set in the preprocessor definitions by default when you make a new multiplatform project like I did, but it is NOT defined in the “liblua” project! Since print() is implemented in liblua’s “LuaStack.cpp” file, and uses CCLOG, it won’t do anything.

So I added COCOS2D_DEBUG=1 to liblua’s preprocessor definitions and it works fine now.

I have this problem too.I want to know how to add COCOS2D_DEBUG=1 to liblua’s preprocessor definitions,could you tell me?