美文网首页
VS+cocos2d-x3.x 调试时打开控制台方法

VS+cocos2d-x3.x 调试时打开控制台方法

作者: invalid_name | 来源:发表于2017-10-15 00:57 被阅读18次

用VS2013调试cocos2dx(3.10)项目,游戏运行后只有游戏窗口,没有控制台小黑窗,无法查看报错及输出信息。解决方法:

  1. 找到项目资源win32下的main.cpp
image.png
  1. 打开main.cpp文件, 添加 如下代码:
 #ifdef WIN32
         _tsetlocale(LC_ALL, _T(""));
         ::AllocConsole();
         ::freopen("conout$", "w", stdout);
         ::freopen("CONIN$", "r", stdin);
         ::freopen("CONOUT$", "w", stderr);
 #endif

3.重新编译,运行就可以看到控制台。

相关文章

网友评论

      本文标题:VS+cocos2d-x3.x 调试时打开控制台方法

      本文链接:https://www.haomeiwen.com/subject/qylquxtx.html