Ogre3D启动程序时显示异常
我正在尝试使用 Ogre 引擎编写游戏。我遇到了很多问题 - GCC 没有编译程序,因为它没有找到 OgreMain_d 和 OIS_d...我创建了 libOgreMain.so.1.7.2 和 libOIS-1.3.0 的符号链接(我使用的是 Linux) .so 和 GCC 编译了我的程序,但是...程序显示错误:
OGRE EXCEPTION(6:FileNotFoundException): 'resources.cfg' 文件未找到!在 ConfigFile::load at /home/m4tx/Programs/ogre_src_v1-7-2/OgreMain/src/OgreConfigFile.cpp (第 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
请帮忙。
I'm trying to write game using Ogre engine. I had a lot of problems - GCC didn't compiled program because it didn't found OgreMain_d and OIS_d... I created symbolic links (I'm using Linux) to libOgreMain.so.1.7.2 and libOIS-1.3.0.so and GCC compiled my program, but... the program shows 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:
#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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的提示在错误消息中很清楚。 Ogre 的示例框架期望某些文件可用,例如
resource.cfg
甚至plugins.cfg
。确保它位于路径中,并且这些资源所需的媒体也可用。Your hint is clearly in the error message. The example framework for Ogre expects certain files to be available, such as
resource.cfg
and evenplugins.cfg
. Make sure this is in the path, and that the media required by those resources is also available.