修改main.cpp
#include "main.h"
#include "AppDelegate.h"
#include "cocos2d.h"
#這里******************************************
#define USE_WIN32_CONSOLE
#***********************************************
USING_NS_CC;
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
#*************************************************
// create the application instance
AppDelegate app;
return Application::getInstance()->run();
#這里******************************************
#ifdef USE_WIN32_CONSOLE
FreeConsole();
#endif
#*************************************************
}