cocos2d 运行示例奇怪的问题,不能弹出调试窗口

本人按照书本教程和网上教程在win7系统上配置vs2013+cocos2dx环境,在其他两台电脑上都能成功调试并弹出游戏运行窗口如图:

可是在另一台电脑上,用同样的系统同样的配置方法调试官方示例,怎么都不行,之前以为是系统问题,就装了win7原版和ghost好几个版本都不行,都能显示编译成功,可是都不会弹出游戏窗口。调试项目时在任务管理器里出现cpp_tests.exe一下后马上消失了。新建了一个项目,也一样,后面干脆拷贝项目的Resources资源到proj.win32文件夹下以xp兼容模式运行也不弹出窗口,真不懂是什么问题,都装了好多遍系统,问题依旧。这个问题困扰好多天了,请教各位大侠了!谢谢!

编译成功 一个报错都没有??

Debug.win32 这个文件里面 有 (你的项目名).exe 的文件 可以打开么?

一个报错都没有,全部成功(显示:========= 生成: 成功 1 个,失败 0 个,最新 3 个,跳过 0 个 ==========)。
Debug.win32 有生成的项目名(HellWorld.exe)打不开,双击没任何反应,可以在任务管理器中看到一下,就自动消失了。

有没有装360 之类的 关掉

右击 HellWorld.exe 以管理员身份运行试试

AppDelegate.cpp
这个文件 的代码贴上来看看

已管理员身份 运行过了,也没反应。以下是AppDelegate.cpp的代码:


#include "AppDelegate.h"
#include "HelloWorldScene.h"
USING_NS_CC;
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate() 
{
}
bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLView::create("My Game");
        director->setOpenGLView(glview);
    }
    // turn on display FPS
    director->setDisplayStats(true);
    // set FPS. the default value is 1.0/60 if you don't call this
    director->setAnimationInterval(1.0 / 60);
    // create a scene. it's an autorelease object
    auto scene = HelloWorld::createScene();
    // run
    director->runWithScene(scene);
    return true;
}
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
void AppDelegate::applicationDidEnterBackground() {
    Director::getInstance()->stopAnimation();
    // if you use SimpleAudioEngine, it must be pause
    // SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
    Director::getInstance()->startAnimation();
    // if you use SimpleAudioEngine, it must resume here
    // SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
}


也退出360了,一样没反应。

glview = GLView::create(“My Game”);

替换

glview = GLViewImpl::create(“My Game”);

director->setOpenGLView(glview);//这个位置打个断点 看看glview 是否为空

你用的什么版本的引擎? 3.0之前的?

director->runWithScene(scene);//断点 看看scene是不是空的

我用的是cocos2d-3.0版本,换成glview = GLViewImpl::create(“My Game”);后GLViewImpl有下划线,分别设置了两处断点信息显示如下:


很奇怪也没改到什么,之前以管理员身份之类的运行都不得,设置一次断点调试后,现在既然可以弹出游戏窗口了(这台电脑第一次弹出此游戏窗口),到现在都不懂是什么原因。总之非常感谢兄台的耐心解答!!!

我猜不知道什么原因 你的scene还没初始化完就跳到 setdisplaystats,你断点了就卡了一下,让hellow有返回值 就没事了

很有可能你清理项目后,重新编译又会有这种问题。