2011-10-11 70 views
0
#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 

程序成功地建立,但是當運行崩潰,並顯示以下消息:食人魔計劃的基礎,但崩潰說「無法找到或打開PDB文件」

'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. 爲什麼程序成功建立時會崩潰?
+0

是否使用'Debug'配置編譯? –

+0

是的。我剛剛從源代碼構建Ogre,僅用於Ogre.sln的Debug構建設置。在構建我的應用程序的同時,它使用了Debug配置。 – Nav

回答

0

該解決方案是指項目的配置屬性,調試,工作目錄爲$(OGRE_HOME)\ BIN \ BIN \ $(配置)

相關問題