A simple change in Hello World project - crash the programm

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mcunha98
Posts: 16
Joined: Mon Jan 02, 2006 6:58 pm
Location: Curitiba / PR - Brazil
Contact:

A simple change in Hello World project - crash the programm

Post by mcunha98 »

Hi,

I try load a X file (replacing only the call to load MD2 file) in HelloWorld_vc8 project (vc++ .net)

Code: Select all

	//IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
	IAnimatedMeshX mesh = smgr->getMesh("d:/apl/blender/hp.x");
	//mesh.setCurrentAnimation (0);
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
Its a basic change, but the compiler have same errors:
>------ Build started: Project: 01.HelloWorld_vc8, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\examples\01.helloworld\main.cpp(149) : error C2259: 'irr::scene::IAnimatedMeshX' : cannot instantiate abstract class
1> due to following members:
1> 'irr::s32 irr::scene::IAnimatedMesh::getFrameCount(void)' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmesh.h(79) : see declaration of 'irr::scene::IAnimatedMesh::getFrameCount'
1> 'irr::scene::IMesh *irr::scene::IAnimatedMesh::getMesh(irr::s32,irr::s32,irr::s32,irr::s32)' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmesh.h(93) : see declaration of 'irr::scene::IAnimatedMesh::getMesh'
1> 'const irr::core::aabbox3d<T> &irr::scene::IAnimatedMesh::getBoundingBox(void) const' : is abstract
1> with
1> [
1> T=irr::f32
1> ]
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmesh.h(97) : see declaration of 'irr::scene::IAnimatedMesh::getBoundingBox'
1> 'irr::core::matrix4 *irr::scene::IAnimatedMeshX::getMatrixOfJoint(irr::s32,irr::s32)' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(29) : see declaration of 'irr::scene::IAnimatedMeshX::getMatrixOfJoint'
1> 'irr::s32 irr::scene::IAnimatedMeshX::getJointCount(void) const' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(33) : see declaration of 'irr::scene::IAnimatedMeshX::getJointCount'
1> 'const irr::c8 *irr::scene::IAnimatedMeshX::getJointName(irr::s32) const' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(39) : see declaration of 'irr::scene::IAnimatedMeshX::getJointName'
1> 'irr::s32 irr::scene::IAnimatedMeshX::getJointNumber(const irr::c8 *) const' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(44) : see declaration of 'irr::scene::IAnimatedMeshX::getJointNumber'
1> 'const irr::core::array<T> *irr::scene::IAnimatedMeshX::getDrawableSkeleton(irr::s32)' : is abstract
1> with
1> [
1> T=irr::core::vector3df
1> ]
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(52) : see declaration of 'irr::scene::IAnimatedMeshX::getDrawableSkeleton'
1> 'irr::s32 irr::scene::IAnimatedMeshX::getAnimationCount(void) const' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(55) : see declaration of 'irr::scene::IAnimatedMeshX::getAnimationCount'
1> 'const irr::c8 *irr::scene::IAnimatedMeshX::getAnimationName(irr::s32) const' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(62) : see declaration of 'irr::scene::IAnimatedMeshX::getAnimationName'
1> 'bool irr::scene::IAnimatedMeshX::setCurrentAnimation(const irr::c8 *)' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(73) : see declaration of 'irr::scene::IAnimatedMeshX::setCurrentAnimation'
1> 'void irr::scene::IAnimatedMeshX::setCurrentAnimation(irr::s32)' : is abstract
1> c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\include\ianimatedmeshx.h(67) : see declaration of 'irr::scene::IAnimatedMeshX::setCurrentAnimation'
1>c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\examples\01.helloworld\main.cpp(149) : error C2440: 'initializing' : cannot convert from 'irr::scene::IAnimatedMesh *' to 'irr::scene::IAnimatedMeshX'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\examples\01.helloworld\main.cpp(151) : error C2664: 'irr::scene::ISceneManager::addAnimatedMeshSceneNode' : cannot convert parameter 1 from 'irr::scene::IAnimatedMeshX' to 'irr::scene::IAnimatedMesh *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>Build log was saved at "file://c:\Arquivos de programas\irrlicht-1.3\irrlicht-1.3\examples\01.HelloWorld\Debug\BuildLog.htm"
1>01.HelloWorld_vc8 - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Anteater
Posts: 266
Joined: Thu Jun 01, 2006 4:02 pm
Location: Earth
Contact:

Post by Anteater »

Try this:

Code: Select all

 //IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
   IAnimatedMeshX* mesh = smgr->getMesh("d:/apl/blender/hp.x");
   //mesh.setCurrentAnimation (0);
   IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); 
Remember, you create a pointer to the mesh.
mcunha98
Posts: 16
Joined: Mon Jan 02, 2006 6:58 pm
Location: Curitiba / PR - Brazil
Contact:

Post by mcunha98 »

I do, but receive a error:
1>------ Build started: Project: 01.HelloWorld_vc8, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>c:\arquivos de programas\irrlicht-1.3\irrlicht-1.3\examples\01.helloworld\main.cpp(149) : error C2440: 'initializing' : cannot convert from 'irr::scene::IAnimatedMesh *' to 'irr::scene::IAnimatedMeshX *'
1> Cast from base to derived requires dynamic_cast or static_cast
1>Build log was saved at "file://c:\Arquivos de programas\irrlicht-1.3\irrlicht-1.3\examples\01.HelloWorld\Debug\BuildLog.htm"
1>01.HelloWorld_vc8 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Remove the X in the second line.
kompromis
Posts: 98
Joined: Mon Sep 11, 2006 2:36 pm
Location: sweden/stockholm

Post by kompromis »

you can't name both mesh
indygoof
Posts: 2
Joined: Fri Apr 15, 2005 9:13 am

Post by indygoof »

Hi,

try that one:

Code: Select all

//IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
   IAnimatedMesh* mesh = smgr->getMesh("d:/apl/blender/hp.x");
   //mesh.setCurrentAnimation (0);
   IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); 
Post Reply