Using ODE in 2005 Problems

Currently I am in the process of converting source from Visual C++ 2003 (7.1 Plaform SDK from DVD) to Visual C++ 2005 (8.0 Platform SDK 2003 SP1).

While I have found the following code will compile fine in 2003, when moving to 2005. It doesn't like it as much.



#include <windows.h>
#include "ode/ode.h"

#pragma comment (lib, "ode.lib")

#define DARKSDK __declspec ( dllexport )

class ODEPhysics
{
 dWorldID World;
 dSpaceID Space;

public:
 ODEPhysics()
 {
  // constructor
  this->World = dWorldCreate();
 }

 ~ODEPhysics()
 {
  // deconstructor
  if(this->World)
   dWorldDestroy(this->World);
 }
};

// prototype
//
DARKSDK void Physics_Start ( void );

ODEPhysics* g_Physics = NULL;

// entry point
//
void Physics_Start ( void )
{
 g_Physics = new ODEPhysics;
}

 



You will need http://www.ode.org in order to build this.
The first thing I noticed was that you need libc.lib which isn't part of 8.0, but this isn't a problem so much. Just set it to ignore that specific library. Next thing I noticed was that _snprintf and _snvprintf have been depricated. While before this wasn't an issue, now it won't compile unless you change them.

although PDK doesn't contain it, DirectX SDK did.. the strsafe.h with the safe string functions.

Changing these worked nicely. Problem now is a printMessage() function now has an _iob error. This is the ony I can't figure out how to get around, as I don't even know what the heck it is.

There's nothing out of the ordinary in the printMessage function either. I did try to recompile the ODE.lib itself with 2005, but that actually caused mroe of a headache than this problem.

Again that will compile fine using 2003. Any help that could be provided would be very useful, as I'm trying to convert some of the basic unimportant libraries to 2005 compatible source, before we move the entire product to 2005 next month after release.



Answer this question

Using ODE in 2005 Problems