报错:
new.exe 中的 0x75579617 处有未经处理的异常: Microsoft C++ 异常: 内存位置 0x0021f664 处的 Ogre::FileNotFoundException。
定位:
virtual void setupResources(void){
…
cf.load(mResourcePath + “resources_d.cfg”);
…
}
分析:
文件无法找到,所以将resources_d.cfg及其资源文件拷贝到相应目录下即可。
.dll文件位置可通过修改[属性]->[配置属性]->[调试]->[工作目录]到其他文件夹.相对dll文件就会相应变化.
第一次编译OGRE配置:
Create a new empty project.
Create a new file for the code and name it main.cpp.
Add the main function:
int main (void)
{
return 0;
}
#include “Ogre\ExampleApplication.h”:
Add PathToYourOgreSDK\include\ to the include path of your project.
Add PathToYourOgreSDK\boost_1_42 to the include path of your project.
Add PathToYourOgreSDK\boost_1_42\lib to your library path.
Add a new class to the main.cpp.
class Example1 : public ExampleApplication
{
public:
void createScene()
{
}
};
Example1 app;
app.go();
11、12. Add
OgreMain_d.lib
OIS_d.lib
to your linked libraries.
Compile the project.
Set your application working directory to PathToYourOgreSDK\bin\debug.
Start the application. You should see the Ogre 3D Setup dialog.