C++ MFC 2008 ERROR: Description: "fatal error C1083: Cannot open include file: 'windows.h':

New_Alex
New_Alex used Ask the Experts™
on
Description: "fatal error C1083: Cannot open include file: 'windows.h': No such file or directory"
File: "afxv.w32.h"
Line 169

This is the error I get when I try to compile an MFC application in Visual Studio 2008

I have already downloaded and installed the SDK for Microsoft Visual Studio 2008.

Any Ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
is your SDK include directory in your include path?
you must add it to INCLUDE environment if you build from command shell, otherwise go to IDE options, locate visual C++ directories, include directories, and make sure %SDK%\include is present --

Commented:
oh -
%SDK% means wherever you installed the SDK, obviously ;-)

Author

Commented:
Thanks lomo


in the List that can be found in:  
View Options / Projects and Solutiona / VC++ Directories / Show directories for: Include files

There is a line:
$(FrameworkSDKDir)include


I don't know if it is this you mean, but even if I copy and paste your line "%SDK%\include" it doesn't seem to get it right ...

What do you think people?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2016

Commented:
your include paths should be

$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)\include
$(FrameworkSDKDir)include

that was done by the vs installation. a separate sdk installation normally makes no sense cause it would install nearly the same files somewhere else and you would need to synchronize the environment.

Sara
Top Expert 2016

Commented:
you can find out what those environment variables mean by openning a cmd window and type for example

set WindowsSdkDir

Open in new window


Sara
Commented:
Hi. I have contacted Microsoft and they asked me to upgrade to Microsoft Visual 2010 and then come back to them for support.

Studio 2010 works fine so I will stick with it.

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial