gpt4 book ai didi

c++ - Ogre3D 在启动程序时显示异常

转载 作者:太空狗 更新时间:2023-10-29 21:29:26 25 4
gpt4 key购买 nike

我正在尝试使用 Ogre 引擎编写游戏。我遇到了很多问题——GCC 没有编译程序,因为它没有找到 OgreMain_d 和 OIS_d...我创建了指向 libOgreMain.so.1.7.2 和 libOIS-1.3.0 的符号链接(symbolic link)(我使用的是 Linux) .so 和 GCC 编译了我的程序,但是...程序显示错误:

OGRE 异常(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

请帮忙。

最佳答案

您的提示在错误消息中很清楚。 Ogre 的示例框架需要某些文件可用,例如 resource.cfg 甚至 plugins.cfg。确保它在路径中,并且这些资源所需的媒体也可用。

关于c++ - Ogre3D 在启动程序时显示异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4836370/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com