Microsoft SDK Version
The error I am getting is here:
#if defined(开发者_开发技巧 _WIN32 )
#ifndef WIN32
#error error // error calls here
#endif
I wrote a program in MS VS2008 that works fine, however when I transfer it over and compile it in MS VS2010, I get a bunch of errors.
Some header files and libraries I include are as follows:
#include stdlib.h
#include stdio.h
#include stdlib.h
#include io.h
#include math.h
#include mmsystem.h
#include iostream
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "odbc32.lib")
#pragma comment(lib, "odbccp32.lib")
Now, I think the problem is this. In VS2008, when I right click on mmsystem.h and say "open containing folder", it points me to: C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include
Whereas in in VS2010 when I do this it points me to: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
- Could this be the source of the errors, and
- How could I make VS2010 point me to
v6.0A\Include
rather thanv7.0A\Include
?
Thanks
You can change the include folder path for you project in the project properties but most likely the errors are not from the included headers but because in Visual Studio 2010 the C++ compiler has changed to be more strict about certain coding styles which where not considered erroneous before.
In most cases the new compiler, while being more strict, will force you to write better code.
But, to know for sure, can you post the specific compile-time errors you're getting?
Here's a link which also might be useful to you if you're trying to change the include directories in Visual Studio 2010 when coming from Visual Studio 2008.
I figured this out finally. In properties->C/C++->Preprocessor->Preprocessor Definitions add WIN32
精彩评论