【问题标题】:Ogre program builds but crashes saying "Cannot find or open the PDB file"Ogre 程序构建但崩溃说“找不到或打开 PDB 文件”
【发布时间】:2011-10-11 09:14:04
【问题描述】:
#include <OgreRoot.h>

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    #define WIN32_LEAN_AND_MEAN
    #include "windows.h"
#endif

#ifdef __cplusplus
    extern "C" {
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
    int main(int argc, char *argv[])
#endif
    {//main
        Ogre::Root* root = new Ogre::Root("plugins.cfg", "ogre.cfg", "Ogre.log");
        delete root;
        return 0;
    }//main
#ifdef __cplusplus
}
#endif

程序构建成功,但运行时崩溃,并显示以下消息:

'NavProjectOgre.exe': Loaded 'C:\Ogre\Programs\NavProjectOgre\Debug\NavProjectOgre.exe', Symbols loaded.  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\Ogre\Programs\NavProjectOgre\Debug\OgreMain_d.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\msvcp100d.dll', Symbols loaded.  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\lpk.dll', Cannot find or open the PDB file  
'NavProjectOgre.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', Cannot find or open the PDB file  
First-chance exception at 0x7c812afb in NavProjectOgre.exe: Microsoft C++ exception: Ogre::FileNotFoundException at memory location 0x0012f46c..  
The program '[4240] NavProjectOgre.exe: Native' has exited with code 0 (0x0). 

有两件事让我印象深刻:

  1. int main(int argc, char *argv[]) 应该由 Visual Studio 以暗色字体显示,因为程序控制无法到达那里,但它以普通彩色字体显示。有问题?
  2. 为什么程序编译成功后会崩溃?

【问题讨论】:

  • 你是用Debug配置编译的吗?
  • 是的。我刚刚从源代码构建了 Ogre,仅用于 Ogre.sln 的调试构建设置。在构建我的应用程序时,它也在使用调试配置。

标签: visual-studio-2010 ogre


【解决方案1】:

解决方法是将项目的配置属性,Debugging,Working Directory指向$(OGRE_HOME)\Bin\bin\$(Configuration)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-27
    • 1970-01-01
    • 1970-01-01
    • 2015-04-07
    • 2013-04-02
    • 1970-01-01
    相关资源
    最近更新 更多