problem calling box collision

danharibo

29-03-2006 19:40:39

when i create a box collision like this:

OgreNewt::Collision *mCollision = new OgreNewt::CollisionPrimitives::Box(mWorld,Ogre::Vector3(3,4,4),Ogre::Quaternion(Ogre::Vector3(1,1,1),Ogre::Vector3(1,1,1),Ogre::Vector3(1,1,1)),Ogre::Vector3(0,0,0));

i get these errors:

dropshipdemo.obj : error LNK2019: unresolved external symbol "public: __thiscall OgreNewt::CollisionPrimitives::Box::Box(class OgreNewt::World const *,class Ogre::Vector3 const &,class Ogre::Quaternion const &,class Ogre::Vector3 const &)" (??0Box@CollisionPrimitives@OgreNewt@@QAE@PBVWorld@2@ABVVector3@Ogre@@ABVQuaternion@5@1@Z) referenced in function "protected: virtual void __thiscall dropshipdemoApp::createScene(void)" (?createScene@dropshipdemoApp@@MAEXXZ)

what am i doing wrong?

walaber

30-03-2006 07:30:11

it seems you are not linking to OgreNewt properly in your project. if you remove the line, does the project compile properly (with other OgreNewt commands remaining) ?

danharibo

30-03-2006 14:33:00

it was building before i added that line, i will check as soon as i get home

danharibo

30-03-2006 14:46:46

no, i just get this error:
dropshipdemo.obj : error LNK2019: unresolved external symbol "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ) referenced in function "protected: virtual void __thiscall dropshipdemoApp::createScene(void)" (?createScene@dropshipdemoApp@@MAEXXZ)
and i only call ogreNewt once to create the world
like this:

OgreNewt::World *mWorld = new OgreNewt::World();

HexiDave

30-03-2006 14:53:32

walaber is saying you need OgreMain.lib added to your linker input. I know in VS 7.1 you right click on your project and go to Properties. Click Linker->Input and paste that in there and apply. Make sure you have OgreNewt's lib directory added to your directory list (Tools->Options->Projects->VC++ Directories, choose Library Files and add the lib folder.)

That should compile fine.

danharibo

30-03-2006 15:06:07

i have added c:\ogrenewt\ogrenewt_main\lib\release to the include dir, and it still dont work

HexiDave

30-03-2006 18:04:43

Yes, but did you put OgreNewt_Main.lib in the linker input? Otherwise it won't know what you want to include from the lib directory and then gives you link errors.

danharibo

30-03-2006 18:18:24

i added ogremain.lib and now i get this:
dropshipdemo.obj : error LNK2001: unresolved external symbol "public: __thiscall OgreNewt::CollisionPrimitives::Box::Box(class OgreNewt::World const *,class Ogre::Vector3 const &,class Ogre::Quaternion const &,class Ogre::Vector3 const &)" (??0Box@CollisionPrimitives@OgreNewt@@QAE@PBVWorld@2@ABVVector3@Ogre@@ABVQuaternion@5@1@Z)
dropshipdemo.obj : error LNK2001: unresolved external symbol "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ)
bin\Debug\dropshipdemo.exe : fatal error LNK1120: 2 unresolved externals

???, :(

danharibo

30-03-2006 20:37:57

i need this problem solved and i have tried everythig i can think of

HexiDave

30-03-2006 22:04:38

Oh, it's the debug version you're outputting? You need to compile OgreNewt in Debug mode or you'll be trying to use the Debug version from the Release library - add the lib\debug directory for OgreNewt and recompile OgreNewt in Debug mode. Double check the lib file name - I think it might be OgreNewt_Main_d.lib. Just replace OgreNewt_Main.lib in the Linker input.

danharibo

30-03-2006 22:36:10

after setting iit to relese i get this:
Linking...
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonMaterialGetDefaultGroupID
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonWorldSetUserData
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreate
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonUpdate
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonGetTimeStep
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonSetWorldSize
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonBodyGetUserData
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonWorldGetUserData
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonBodyGetWorld
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonDestroy
OgreNewt_Main.lib(OgreNewt_World.obj) : error LNK2001: unresolved external symbol __imp__NewtonSetBodyLeaveWorldEvent
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateBox
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateSphere
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateCylinder
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateCapsule
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateCone
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateChamferCylinder
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateConvexHull
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Ogre::MeshPtr & __thiscall Ogre::Entity::getMesh(void)" (__imp_?getMesh@Entity@Ogre@@QAEAAVMeshPtr@2@XZ)
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonTreeCollisionEndBuild
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonTreeCollisionAddFace
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonTreeCollisionBeginBuild
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateTreeCollision
OgreNewt_Main.lib(OgreNewt_CollisionPrimitives.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateCompoundCollision
OgreNewt_Main.lib(OgreNewt_MaterialID.obj) : error LNK2001: unresolved external symbol __imp__NewtonMaterialCreateGroupID
OgreNewt_Main.lib(OgreNewt_Collision.obj) : error LNK2001: unresolved external symbol __imp__NewtonReleaseCollision
OgreNewt_Main.lib(OgreNewt_Collision.obj) : error LNK2001: unresolved external symbol __imp__NewtonCollisionCalculateAABB
OgreNewt_Main.lib(OgreNewt_Tools.obj) : error LNK2001: unresolved external symbol __imp__NewtonCollisionCalculateAABB
OgreNewt_Main.lib(OgreNewt_Collision.obj) : error LNK2001: unresolved external symbol __imp__NewtonCreateConvexHullModifier
OgreNewt_Main.lib(OgreNewt_Collision.obj) : error LNK2001: unresolved external symbol __imp__NewtonConvexHullModifierSetMatrix
OgreNewt_Main.lib(OgreNewt_Collision.obj) : error LNK2001: unresolved external symbol __imp__NewtonConvexHullModifierGetMatrix
OgreNewt_Main.lib(OgreNewt_Tools.obj) : error LNK2001: unresolved external symbol __imp__NewtonCollisionPointDistance
OgreNewt_Main.lib(OgreNewt_Tools.obj) : error LNK2001: unresolved external symbol __imp__NewtonCollisionClosestPoint
OgreNewt_Main.lib(OgreNewt_Tools.obj) : error LNK2001: unresolved external symbol __imp__NewtonCollisionCollide
OgreNewt_Main.lib(OgreNewt_Tools.obj) : error LNK2001: unresolved external symbol __imp__NewtonCollisionCollideContinue
OgreNewt_Main.lib(OgreNewt_Tools.obj) : error LNK2001: unresolved external symbol __imp__NewtonCollisionRayCast
bin\Release\dropshipdemo.exe : fatal error LNK1120: 35 unresolved externals

what have i done wrong this time?

HexiDave

30-03-2006 23:14:06

Ok so the run-down:

You have #include <OgreNewt.h> at the top of your file?
You have OgreNewt_Main.lib and newton.lib included in your lib directories for release mode, compiled both libraries under release mode and have them in your Linker input?
You can compile the demos included with OgreNewt and run them?

If those still happen and you STILL have problems, try going to the OgreNewt solution you have with the demos and libraries and just remove all the files from one of the projects and add yours - see if it works then. If you still get link errors, then I'm at a loss.

danharibo

30-03-2006 23:25:38

included all dirs contanig newton.lib and still not workin

HexiDave

31-03-2006 00:31:55

Did you try using one of OgreNewts projects and emptying it and adding all your files? If it craps out there, then you might want to copy your project and it's files, download all the source from scratch and build everything again.

danharibo

31-03-2006 16:26:58

i tred to re-build OgreNewt a while ago and it had errors.

danharibo

31-03-2006 18:54:24

anybody got the ogrenewt_main.dll release?