Help using ODE with Panda3d & C++

Hello everyone,

Has anyone tried using ODE with C++ and Pand3D. I am getting a lot of errors when I try to do so. The Panda manual does not seem to have much support for using ODE with C++. It would be great if someone could direct me in the right direction to get things to work.

Thank you!!

What issues in particular are you running into? It’s supposed to work fine.

So I have been looking at the manual to get the ODE to work. panda3d.org/manual/index.php/U … th_Panda3D

After the first page there is no documentation on implementing it in C++, however that page did show how to add physics to a loaded Panda model. But when I try to compile, firstly it throws an error that it cannot find the ‘ode/ode.h’ file in ‘ode_includes.h’. I tried manual fixing that by dropping ode.h into a ode folder that I created in the ‘include’ folder in Panda3D install directory. But then it throws a bunch of errors about encountering structs which haven’t been defined.

I am pretty new to Panda3D so it might be something very silly that I am doing. Any help would be greatly appreciated. If you need any further info or a snapshot of the errors I am getting, let me know and I shall provide i to you. Thank you for helping me out.

Whoops, that’s right - panda does not ship with the ODE headers. You need to download the version of ODE that Panda was compiled against (I’m guessing its 0.9) and put all of the headers in the include path. (not just ode/ode.h)

Sweeeet! I am going to try that out and let you know if I am able to compile. Thank you so much!

So I was able to compile without any issues! Thanks! However I got linker errors:

Error 1 error LNK2001: unresolved external symbol “__declspec(dllimport) public: __thiscall OdeMass::OdeMass(void)” (_imp??0OdeMass@@QAE@XZ) Panda3D_pilot.obj Panda3D_pilot

I tried adding the .lib and .dll files but it still gave me the errors. Any suggestions on what might me going wrong? Thanks again!

Also, I see that the size of the ode.dll is different in the panda3d bin folder when I compare it to the releasedll in the ODE 0.9 source code. Could it be that Panda3d was compiled with another version? Will that lead the above linking error though?

Possibly. But it should be right if you use the version of ODE in the thirdparty packages on the download page - it includes the headers and dll. So that’s what I would try.

So I took the header files and ode.lib from the panda3d complete source code. But I am still getting the linker errors. I am pretty sure I am missing some .lib file which is causing this problem.

Here is how I included the ode.lib in my project:

  1. I copied the ode.lib into the Panda3D-1.6.2\lib\ path.
  2. I added the ode.lib under, Project properties->Linker->Input->Additional Dependencies, along with other panda framework library files.

Are there any other ode library files I need to add?

The ode.dll already exists in Panda3d bin folder.

Oh, stupid me. I just realized that the symbol above is actually a symbol from Panda, not from ODE.
Try adding libpandaode.lib to your dependencies. I think you can remove ode.lib then as it’s statically linked, although I’m not 100% sure.

Awesome stuff pro-rsoft!!! I just included it and I was able to compile and NO Linker errors! Can’t wait to test all the physics now. Thanks a lot! You have been of great help!!