2011-01-29 65 views
3

我正在嘗試使用Ogre引擎編寫遊戲。我遇到了很多問題 - GCC沒有編譯程序,因爲它沒有找到OgreMain_d和OIS_d ...我創建了符號鏈接(我正在使用Linux)libOgreMain.so.1.7.2和libOIS-1.3.0的.so和GCC編譯了一個程序,但...該程序顯示錯誤:Ogre3D在啓動程序時顯示異常

OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' file not found! in ConfigFile::load at /home/m4tx/Programs/ogre_src_v1-7-2/OgreMain/src/OgreConfigFile.cpp (line 83)

我的代碼:

#define OGRE_CHANGE1 ((1 << 16) | (1 << 8)) 

#include "Ogre.h" 
#include "ExampleApplication.h" 

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
#define WIN32_LEAN_AND_MEAN 
#include "windows.h" 
#else 
#include <iostream> 
#endif 

// Dziedziczymy ExampleApplication 
class MyApp : public ExampleApplication 
{ 
    protected: 
    public: 
    MyApp() 
    { 
    } 

    ~MyApp() 
    { 
    } 
    protected: 
    void createScene(void) 
    { 
    } 
}; 

#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 
{ 
    MyApp App; 
    try 
    { 
    App.go(); 
    return 0; 
    } 
    catch (Ogre::Exception& e) 
    { 
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
    MessageBox(NULL, e.getFullDescription().c_str(), "Exception!", 
      MB_OK | MB_ICONERROR | MB_TASKMODAL); 
#else 
    std::cerr <<"Exception:\n"; 
    std::cerr <<e.getFullDescription().c_str() <<"\n"; 
#endif 
    return 1; 
    } 
} 

#ifdef __cplusplus 
} 
#endif 

請幫助。

+2

程序目錄中是否有`resources.cfg`文件? `ExampleApplication`類(或Ogre本身)顯然需要一個類。 – 2011-01-29 10:39:13

回答

3

你的提示很明顯在錯誤信息中。 Ogre的示例框架預計某些文件可用,例如resource.cfg甚至plugins.cfg。確保它在路徑中,並且這些資源所需的媒體也可用。

+0

好的,但是在哪裏得到這些文件? :) – m4tx 2011-01-29 11:43:18

相關問題