Some linker errors

robindegen

15-04-2009 20:12:35

Hey,

I'm trying to implement nxogre into my game. All the initialisation with the scene etc. compiled just fine. However now then i'm actually trying to load my shapes i'm running into problems. I have tried searching but i found nothing usefull. I have the simple line of code:


NxOgre::ResourcePtr r = NxOgre::ResourceSystem::getSingleton()->open("data/levels/testmap1conv.nxs");


However this gives linker errors in my visual studio 2008:

Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall NxOgre::ArchiveResourceIdentifier::~ArchiveResourceIdentifier(void)" (__imp_??1ArchiveResourceIdentifier@NxOgre@@QAE@XZ) referenced in function "private: void __thiscall Engine::initPhysics(void)" (?initPhysics@Engine@@AAEXXZ) engine.obj AeonEngine
Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall NxOgre::ArchiveResourceIdentifier::ArchiveResourceIdentifier(char const *)" (__imp_??0ArchiveResourceIdentifier@NxOgre@@QAE@PBD@Z) referenced in function "private: void __thiscall Engine::initPhysics(void)" (?initPhysics@Engine@@AAEXXZ) engine.obj AeonEngine
Error 3 fatal error LNK1120: 2 unresolved externals ..\bin\haxinids_d.exe AeonEngine


looks like it cant find the constructor and destructor of ArchiveResourceIdentifier. I tried linking nxogre both static and not static, and the problem stayed.

betajaen

15-04-2009 20:29:43

You don't have a protocol specified. I'm also guessing you didn't actually create an archive, due to your malformed ARI there.

http://nxogre.org/documentation/bloodym ... urcesystem

To save you some time; Just create the archive as shown in the documentation, then use the MeshManager to load it for you.

robindegen

15-04-2009 22:35:17

thank you. I seem to have missed that documentation, as i was searching through the wiki and forums mostly. Which brings me to my next problem. I'm trying to define a mesh as my scene geometry.

NxOgre::ResourcePtr r = NxOgre::ResourceSystem::getSingleton()->open("levels:testmap1conv.nxs", NxOgre::Enums::ResourceAccess_ReadOnly);
//NxOgre::Shape *s = new NxOgre::Shape();
//NxOgre::MeshManager::getSingleton().load
NxOgre::Mesh *m = new NxOgre::Mesh();
m->load(r);

//NxOgre::Shape *shape = new NxOgre::Convex(NxOgre::Resources::ResourceSystem::getSingleton()->getMesh( "yarr"));
//mPhysicsScene->createSceneGeometry(


The only mesh->shape i could find was NxOgre::Convex.. which i found on this forum somewhere.. it seems it changed in the latest version. The only other examples i can find use a plane. Am i really that bad at searching, or is it really discussed nowhere? :|

by the way, betajaen i think you are doing a great job.. whenever somebody asks something on the forum here you're allways here with a good reply. The docs are comming along nicely, it just doesn't feature the part i need yet hehe

betajaen

15-04-2009 23:11:01

Roughly to load a mesh for you is.

ResourceSystem::getSingleton->createArchive("levels", "file://./data/levels/");
Mesh* testmap = MeshManager::getSingleton()->load("levels:testmap1conv.nxs");

mScene->createStaticGeometry(new TriangleGeometry(testmap));


I assume it's a Triangle Mesh due it being a "map".

robindegen

15-04-2009 23:24:31

hmmmm.. i downloaded a version called BloodyMess.25Feb2009, i downloaded one called NxOgre.1.5.3.BloodyMess now.. and it's that simple... jeez.. hehe. Thanks a lot. :D The only thing is that the static geometry doesnt seem to exist anymore. Has this become the kenetic actor? or is it createSceneGeometry?

spacegaier

16-04-2009 00:02:29

No, KinematicActors aren't the same as StaticGeometry. StaticGeometry can't be moved (as it's static ;) ), however KinematicActors can be moved, but do not respond to forces.

BloodyMess.25Feb2009 = 1.5.2 = old
1.5.3 = most current one

AND: There is the createStaticGeometry() function in!

robindegen

16-04-2009 00:08:45

that is very very odd. I downloaded 1.5.3, and if i do a full search in it's source for createStaticGeometry.. it's not there. Am i going crazy? lol

spacegaier

16-04-2009 00:11:12

Ahh...my fault: It's called createSceneGeometry()

robindegen

16-04-2009 00:11:50

Ahhhh.. now i can sleep peacefully again. Thanks a lot both of you :) . After messing around some more i finally seen the light and it works perfectly now.