Integrating ODE

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
benoit808
Posts: 8
Joined: Fri Oct 06, 2006 6:47 pm

Integrating ODE

Post by benoit808 »

I've been trying to integrate Irrlicht and ODE using the tutorial at http://irrlicht.sourceforge.net/tut_ode.html
However, I keep getting linker errors eventhough I am pretty confident that I included all the libraries as needed. It looks like the tutorial is for old verions of Irrlicht and ODE. Is there some more recent code out there?
Were you able to get this tutorial to work with Irrlicht 1.1 and ODE 0.7?

Thanks
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Post the linker errors.
benoit808
Posts: 8
Joined: Fri Oct 06, 2006 6:47 pm

Post by benoit808 »

>> Error 31 error LNK2001: unresolved external symbol "private: static struct dxWorld * Irrlicht::m_TheWorld" (?m_TheWorld@Irrlicht@@0PAUdxWorld@@A) Irrlicht_test.obj
>> Error 32 error LNK2001: unresolved external symbol "private: static struct dxSpace * Irrlicht::m_TheSpace" (?m_TheSpace@Irrlicht@@0PAUdxSpace@@A) Irrlicht_test.obj
>> Error 33 error LNK2001: unresolved external symbol "private: static struct dxJointGroup * Irrlicht::m_TheJointGroup" (?m_TheJointGroup@Irrlicht@@0PAUdxJointGroup@@A) Irrlicht_test.obj
>> Error 34 fatal error LNK1120: 3 unresolved externals F:\Projects\Irrlicht\Debug\Irrlicht_test.exe
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Looks like you have something like this in your code...

Code: Select all

class Irrlicht
{
   //...

private:
   static dxWorld* m_TheWorld;
   static dxSpace* m_TheSpace;
   static dxJointGroup* m_TheJointGroup;
};
The problem is that you have declared the static variables in the header, but you need to define them.

Code: Select all

// this goes in a .cpp file, hopefully where the Irrlicht class functions are defined.
dxWorld* Irrlicht::m_TheWorld = 0;
dxSpace* Irrlicht::m_TheSpace = 0;
dxJointGroup* Irrlicht::m_TheJointGroup = 0;
Travis
benoit808
Posts: 8
Joined: Fri Oct 06, 2006 6:47 pm

Post by benoit808 »

That did it!
Thought that was some library issues but it was just a plain lack of C++ skills :P

Thanks a lot vitek
Post Reply