[Solved]Get Linker Error During initialisation

aoos

17-08-2008 10:21:44

Hi! i tried to set up an application using OgreNewt but i get linker errors when i set up the world and frameListener Heres my code



class MyApplication : public OgreApplication
{
public:
MyApplication(void);
~MyApplication();
virtual void createScene();
virtual bool frameStarted(const FrameEvent& evt);
virtual void createFrameListener();
protected:
Entity* ogreHead;
SceneNode* headNode;
OgreNewt::World* mWorld;
};

//-------------------------------------------------------------------------------------
MyApplication::MyApplication()
: ogreHead(0),
headNode(0)
{
mWorld = new OgreNewt::World();
}
//-------------------------------------------------------------------------------------
void MyApplication::createScene()
{
ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");

headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);

// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));

// Create a light
Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
}
//-------------------------------------------------------------------------------------
bool MyApplication::frameStarted(const FrameEvent& evt)
{

headNode->translate(0.0f, 0.005f, 0.0f);

if (mKeyboard->isKeyDown(OIS::KC_SPACE))
{
headNode->yaw(Degree(-0.05));
}

return OgreApplication::frameStarted(evt);
}
//-------------------------------------------------------------------------------------

void MyApplication::createFrameListener()
{
mListener = new FrameListener();
mRoot->addFrameListener(this);

OgreNewt::BasicFrameListener* mOgreNewtListener;
mOgreNewtListener = new OgreNewt::BasicFrameListener( mWindow, mSceneMgr, mWorld, 120 );
mRoot->addFrameListener( mOgreNewtListener );

}
//-------------------------------------------------------------------------------------
MyApplication::~MyApplication()
{
delete mWorld;
}
//-------------------------------------------------------------------------------------


the linker errors are:

main1.obj : error LNK2001: unresolved external symbol "public: __thiscall OgreNewt::World::~World(void)" (??1World@OgreNewt@@QAE@XZ)
main1.obj : error LNK2001: unresolved external symbol "public: __thiscall OgreNewt::World::World(void)" (??0World@OgreNewt@@QAE@XZ)
main1.obj : error LNK2001: unresolved external symbol "public: __thiscall OgreNewt::BasicFrameListener::BasicFrameListener(class Ogre::RenderWindow *,class Ogre::SceneManager *,class OgreNewt::World *,int)" (??0BasicFrameListener@OgreNewt@@QAE@PAVRenderWindow@Ogre@@PAVSceneManager@3@PAVWorld@1@H@Z)



What's wrong can u help??

aoos

17-08-2008 16:21:30

i figured out how to do it! Sorry for the post