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 public: ~ODEPhysics() // prototype ODEPhysics* g_Physics = NULL; // entry point |
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.

Using ODE in 2005 Problems
A.Y. Faizal Ahmd
Hi,
If you ignore CRT library, you won't get resolution for CRT functions. Try building your code with /MT vs. /ML instead, http://msdn2.microsoft.com/en-US/library/2kzt1wy3.aspx
Second, this is true that _snprintf and _snwprintf are deprecated because of reasons described on this page http://msdn2.microsoft.com/en-us/library/8ef0s5kh.aspx. You can either define _CRT_SECURE_NO_DEPRECATE in your code or on the compiler's command line, or switch to use safer variants of these functions http://msdn2.microsoft.com/en-us/library/f30dzcf6.aspx
I cannot confirm strsafe.h missing. I see it in Win2k3 SP1 PSDK, Platform SDK folder in Visual Studio 2005 and in Vista Windows SDK.
I am not sure what printMessage() finction is. I assume this is NetShell function PrintMessage(). You may want to ask this question on Windows SDK forums, http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=121&SiteID=1
Hope this helps,
Nikola
VC++