cocos2dx 3.17 lua 运行带控制台输出
1.查看新建项目里面的win32/main.cpp. 2.修改入口函数内容 #include "main.h" #include "SimulatorWin.h" #include <shellapi.h> #define USE_WIN32_CONSOLE //加入 int WINAPI _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 //auto simulator = SimulatorWin::getInstance(); //屏蔽 //return simulator->run(); //屏蔽 int ret = SimulatorWin::getInstance()->run(); //下面加入 #ifdef