"windows.h no such file or directory" in Visual Studio 2008! Help
I wrote simple "hello world" by MFC. I get this error message
***fatal error 1083: windows.h no such file or directory***
Note: i'm using Visual Studio 2008 - full version in college, so i do not have permission to install anything...
Any suggestions?
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Start Visual Studio. Go to Tools->Options and expand Projects and solutions.
Select VC++ Directories from the tree and choose Include Files from the combo on the right.
You should see: $(WindowsSdkDir)\include - (default.)
If this is missing, you found a problem. If not, search for a file. It should be located in
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include if VS was installed in default directory.
Enter path for windows.h in the new line of above mentioned place.
windows.h should be from proper version of the SDK installation, otherwise your program may not compile.
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Quote:
Originally Posted by
f.ben.isaac
I wrote simple "hello world" by MFC. I get this error message
***fatal error 1083: windows.h no such file or directory***
Note: i'm using Visual Studio 2008 - full version in college, so i do not have permission to install anything...
Any suggestions?
Did you use the MFC app wizard or write the code by hand?
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Quote:
Originally Posted by
JohnCz
Start Visual Studio. Go to Tools->Options and expand Projects and solutions.
Select VC++ Directories from the tree and choose Include Files from the combo on the right.
You should see: $(WindowsSdkDir)\include - (default.)
If this is missing, you found a problem. If not, search for a file. It should be located in
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include if VS was installed in default directory.
Enter path for windows.h in the new line of above mentioned place.
windows.h should be from proper version of the SDK installation, otherwise your program may not compile.
I followed your instructions:
i have seen several lines in the list, $(WindowsSdkDir)\include was one of them
However, i went to C:\Program Files\Microsoft SDKs\Windows\v6.0A\,
v6.0A folder only contains bin & Bootstrapper. There isn't "include" folder.
Underneath Windows folder, there are v6.0A and v5.0. v5.0 folder contains lib & include folders...
I put C:\Program Files\Microsoft SDKs\Windows\v5.0\include in place of $(WindowsSdkDir)\include, i got this error while building
Error 1 fatal error C1189: #error : Your version of the Windows SDK is earlier than 6.0. Try setting the 'WINVER' and '_WIN32_WINNT' definitions in your project to less than 0x0600. c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxwin.h 26 hello
Then i tried to put all these paths together in the list:
C:\Program Files\Microsoft SDKs\Windows\v5.0
C:\Program Files\Microsoft SDKs\Windows\v6.0A
$(WindowsSdkDir)\include
.
.
many more included by default.
I rebuild, i got same old error
fatal error 1083: windows.h no such file or directory
Any idea?! Odd
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Quote:
Originally Posted by
Arjay
Did you use the MFC app wizard or write the code by hand?
Referring to the tutorial, it said to choose Win32 App. Note: the tutorial is using a quite old version of VC++....
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
V5.0 is not for x86 processor. Use v6.0A.
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Quote:
Originally Posted by
JohnCz
V5.0 is not for x86 processor. Use v6.0A.
Ok...I just did it, i still get this annoying error!
fatal error 1083: windows.h no such file or directory
I guess there was a problem in the installation process
I used this header in my code #include <afxwin.h>
windows.h is inside afxwin.h
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
You've mentioned in your first post that you are using Visual Studio 2008.
I'm confused by the fact that versions 5.0 and 6.0a are mentioned.
What Visual Studio version are you using?
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Quote:
Originally Posted by
Arjay
You've mentioned in your first post that you are using Visual Studio 2008.
I'm confused by the fact that versions 5.0 and 6.0a are mentioned.
What Visual Studio version are you using?
Visual Studio 2008
Our faculty machines have Visual Studio 2005, 2008, and .NET 2003
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Hi Arjay,
VS 2008 does not have Windows.h in native installation folder. This file is located in SDK installation folder. There are two folders located under Microsoft SDKs: \Windows\v6.0A\Include and \Windows\v5.0\Include.
V6.0A is for x86.
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Quote:
Originally Posted by
JohnCz
Hi Arjay,
VS 2008 does not have Windows.h in native installation folder. This file is located in SDK installation folder. There are two folders located under Microsoft SDKs: \Windows\v6.0A\Include and \Windows\v5.0\Include.
V6.0A is for x86.
What should i do to have windows.h?
THANKS
Re: "windows.h no such file or directory" in Visual Studio 2008! Help
Well, it is hard to determine what is the problem without actually trying to build with your settings.
If windows.h exists in C:\Program Files\Microsoft SDKs\Windows\v6.0A\ directory your settings are wrong.
You may have settings mixed from other versions of VS.
Create new project using app wizard and build it. See if the error persists.
If yes, export current settings and reset all VS settings to default value.
Build and see if problem is still there. If it is we will have to take it from there.