Ogre3D shows an exception at program startup

I am trying to write a game using the Ogre engine. I had a lot of problems - GCC did not compile the program because it did not find OgreMain_d and OIS_d ... I created symbolic links (I use Linux) for libOgreMain.so.1.7.2 and libOIS-1.3.0.so and GCC compiled my program, but ... the program shows an error:

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)

My code is:

#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

Please, help.

+3
source share
1 answer

The error message explicitly states. An example Ogre structure expects some files to be available, for example, resource.cfgand even plugins.cfg. Make sure this is the way to go and that the facilities required by these resources are also available.

+3
source

Source: https://habr.com/ru/post/1788664/


All Articles