您的位置:首页 > 移动开发 > Cocos引擎

cocos2dx输出信息重定向到控制台

2016-03-17 14:47 274 查看
重定向输出到控制台,方便调试,代码:

// uncomment below line, open debug console
#define USE_WIN32_CONSOLE

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR    lpCmdLine,
int       nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

#ifdef USE_WIN32_CONSOLE
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
#endif

// create the application instance
AppDelegate app;

int ret = Application::getInstance()->run();

#ifdef USE_WIN32_CONSOLE
FreeConsole();
#endif

return ret;
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: