• Advertisement
Sign in to follow this  

error windows.h

This topic is 2980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Sorry, if this is posted somewhere; however, I have looked and nothing seems to solve my issue. This is my code: //Beginning Game Programming, 2nd Edition //Chapter 1 - HelloWorld Program #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { MessageBox(NULL, "Motoko Kusanagi has hacked your system!", "Public Security Section 9", MB_OK | MB_ICONEXCLAMATION); } and I get the c1083 error. Could someone help me by telling me possible solutions and ways to ensure that my path to the header file is not blocked. I'm am using VS2008 pro edition with windows sdk aug 2009. If you need more info let me know. Thanks, Dave the humble novice programmer.

Share this post


Link to post
Share on other sites
Advertisement
The message is:

Error 1 fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

Thanks.

Share this post


Link to post
Share on other sites
Did you install the windows SDK?

http://msdn.microsoft.com/en-us/windows/bb980924.aspx

edit: oh, you said in your post that you did... did it correctly set up the include paths in visual studio? ( tools > options > projects and solutions > VC++ directories )

Share this post


Link to post
Share on other sites
This is what is in the include file in the VC++ directories:

$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(VCInstallDir)atlmfc\include

I must admit that I might have deleted a few items trying to solve another problem. I recently added the SDK include so I'm not even sure that's correct.

Thanks.

Share this post


Link to post
Share on other sites
Try reinstalling the SDK, you're missing the include paths to the windows sdk, which isn't under VCInstallDir

Share this post


Link to post
Share on other sites
Also, this is a bit strange because it claims in comments to be a Hello World program, but it clearly isn't.

Share this post


Link to post
Share on other sites
Unfortunately, I tried that already. I even uninstalled VS2008 and to no avail. Not to mention all the entries in the uninstall location that has SDK written in the titles. Well, I'll give it another try. Any suggestions on which SDK to uninstall? Is there a way I can just type in the missing entries (assuming I can find that info)?

Thanks.

Share this post


Link to post
Share on other sites
In a first time, try to write the full path :
#include "C:\\folder01\\folder02\\.....\\windows.h"

(to give you an idea, on my PC it's C:\Program Files\Microsoft SDKs\Windows\v7.0\include\Windows.h)

Share this post


Link to post
Share on other sites
Your VC++ include directories should have an entry like this:
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

Of course, you should replace this with the path that you installed the Platform SDK on. $(VCInstallDir)PlatformSDK\include is almost certainly not correct.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement