rossb83
rossb83

Reputation: 1762

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

  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

Upvotes: 0

Views: 2017

Answers (2)

rossb83
rossb83

Reputation: 1762

I figured this out finally. In properties->C/C++->Preprocessor->Preprocessor Definitions add WIN32

Upvotes: 0

Mike Dinescu
Mike Dinescu

Reputation: 55760

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.

Upvotes: 1

Related Questions