编译OgreOde问题集锦

来源:互联网 发布:python 获取日期时间 编辑:程序博客网 时间:2024/05/21 14:49

问题1:

方法:

这个异常是因为找不到资源组Bootstrap,Bootstrap资源组是OGRE比较早期的版本使用的名字。打开resource.cfg文件,用中括号表示的就是资源组名,可以看到在1.7.1中有两个资源组,一个叫essential,一个叫general。我们可以查看Ogre1.4的资源配置文件:

这个配置文件中就有了Bootstrap,它定位到一个压缩文件OgreCore.zip。这个文件在我们使用SVN下载的ogreode目录下,你可以在C:\OGRE1-7-1\ogreode\demos\Media\packs目录下找到它,这样我们就可以修改demo程序所在的目录的资源配置文件。将essential改为Bootstrap,并添加Zip=C:/OGRE1-7-1/ogreode/demos/Media/packs/OgreCore.zip行,保存。

问题2:

ParticleSystem template with name 'myExplosionTemplate' already exists

方法:在media文件中搜索MyExplosion.particle,搜索到以后直接删除。如果遇到类似的问题,方法于此相同。

问题3:

OGRE EXCEPTION(7:InternalErrorException): Unable to find CG profile enum for program DOF_Blend_ps: The parameter used is invalid. in CgProgram::selectProfile at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)

方法:重启电脑。

问题4:error C2872: 'uint32' : ambiguous symbol

方法:我调整了一下#include的顺序。

问题5:error C2039: 'setUserObject' : is not a member of 'Ogre::Entity'

方法:换成下面的试试看

entity->setUserAny(Ogre::Any(mGeom));entity->setUserAny(Ogre::Any(mGround));

问题6:error C2039: 'setNormaliseNormals' : is not a member of 'Ogre::Entity'

方法:这个函数调用并不是必须的,Ogre会默认的执行这样的效果。

问题7:error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'

方法:在Windows编程中,如果使用VS2005/VS2008可能会碰到这样的错误,如代码:

MessageBox( NULL, "Hello,Windows", "HelloWorld", MB_OK);
会出现类似的错误:
Error 1 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR' c:\documents and settings\administrator\my documents\visual studio 2008\projects\hellowindows\hellowindows\hellowindows.cpp 32 HelloWindows
解决的办法是:MessageBox( NULL, TEXT("Hello,Windows"), TEXT("HelloWorld"), MB_OK);即可
问题8:assertion "dMassCheck(mass)" failed in... ...
方法:出现这个的原因是因为Mass对象需要两个参数,一个是实数表示质量,一个是实数表示半径。要确定你在初始化Mass对象的时候这两个值是大于0的。
问题9:errorC2065:'dJointTypePU':undeclaredidentifier

方法:这是由于ODE的版本有问题。你使用的是ode 1.6版本的,可以试一下ode 1.10版本以上的。

问题10:无法定位程序输入点?getMaxAllocationSize@NedPoolingPolicy@Ogre@@SAIXZ于动态链接库OgreMain_d.dll。

方法:这是由于Ogre版本不一致导致的错误,可能你需要找到OgreSE用到的版本,然后重新编译OgreOde。

问题11:Error 18 error C2259: 'CSceneDoc' : cannot instantiate abstract class f:\ogreodebuild3\my\hello\hello\scenedoc.cpp 28 HELLO

方法:错误原因:一个实现类继承了一个抽象基类,但是却没有把抽象基类中的方法全部实现。

问题12:Error 7 error LNK2001: unresolved external symbol "private: virtual bool __thiscall OgreSE::Scene::collision(class OgreOde::Contact *)" (?collision@Scene@OgreSE@@EAE_NPAVContact@OgreOde@@@Z) SceneDoc.obj HELLO

方法:这是一个链接错误,意思是:没有找到这个函数的实现。
可能的原因如下:
1、此函数在代码中已经进行了声明,但却没有实现该函数;
2、代码中引用了第三方模块中的函数,却没有将包含该函数的库文件(就是lib文件)链接进程序中;
3、代码中引用了一个不存在的函数。
解决方法:
检查该函数的实现部分是否存在或包含该函数的lib文件是否正确的链接进代码中,查明错误后修正即可通过链接。

问题13:用CMake编译OgreOde的时候出现一项错误:OGRE_BUILD  OGRE_BUILD-NOTFOUND

方法:OGRE_BULID文件路径要选择包含“lib”的路径,这个路径在编译Ogre之后的文件目录下。

 问题14:LINK : fatal error LNK1104: cannot open file "C:\Program.obj"

方法:这是由于你在“工程->属性->Linker->Input->Additional Dependencies”下面配置的路径不正确。有可能是应该写成两行的,而你写成了一行。

问题15:出现如下图所示的错误,

OGRE EXCEPTION(2:InvalidParametersException): Parameter called camObjPos does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1435)
Compiler error: invalid parameters in Examples.material(837): setting of constant failed

方法:请检查一下resources_d.cfg文件[Essential]是不是缺少Zip=../../media/packs/OgreCore.zip.

问题16:OGRE EXCEPTION(2:InvalidParametersException): Cannot find requested affector type. in ParticleSystemManager::_createAffector at ..\..\..\..\OgreMain\src\OgreParticleSystemManager.cpp

方法:。。。。。。

问题17:Could not find material Core/StatsBlockCen

方法:请检查一下resources_d.cfg文件[Essential]是不是缺少Zip=../../media/packs/OgreCore.zip


原创粉丝点击