开发者

Microsoft SDK Version

开发者 https://www.devze.com 2023-02-18 08:47 出处:网络
The error I am getting is here: #if defined(开发者_开发技巧 _WIN32 ) #ifndef WIN32 #error error // error calls here

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

  1. Could this be the source of the errors, and
  2. How could I make VS2010 point me to v6.0A\Include rather than v7.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

0

精彩评论

暂无评论...
验证码 换一张
取 消