Handmade Hero»Forums»Code
xel
18 posts
presses plastic buttons for fun
Including windows.h in my file causes 139 errors
Edited by xel on
Here are the exact steps that I take:

1) Open Visual Studio Community (Running on Windows 8.1)

2) Create New "Win32 Project"

3) In the "Application Settings" menu I have "Windows application" as the application type, I check "Empty project", and I uncheck everything else. Then "finish".

4) I add a new file "test.cpp" under the folder "Source Files"

5) Into test.cpp, I write: #include <windows.h>

At this point, I have 139 errors in my error list. I have appended the build output to the bottom of this post.

I'm very confused, no one else seems to be having this problem. Notice how all the errors are happening at "c:\program files (x86)\windows kits\8.1\", there's another folder in "windows kits" called "8.0", is VS using the wrong Windows SDK?

I have tried reinstalling Visual Studio, and I have tried reinstalling both Windows SDK 8.1 and 8.0.

Thanks for any help!

Pastebin link to errors: pastebin.com/C4ipZpHd

Update: I have uninstalled VS2013 Community, and installed VS2015. I still can't compile, but the errors are much more readable. http://pastebin.com/jDBDB4FS. All the build errors appear to be coming from one file: specstrings_undef.h. This is really confusing.
Anthony
7 posts
Including windows.h in my file causes 139 errors
Please edit your post and remove that giant wall of code.

You can use something like pastebin instead. It keeps your post looking clean and still allows people to look at your error log.

I uploaded it for you here:
http://pastebin.com/C4ipZpHd
xel
18 posts
presses plastic buttons for fun
Including windows.h in my file causes 139 errors
Done. Thanks.
xel
18 posts
presses plastic buttons for fun
Including windows.h in my file causes 139 errors
Hooray! I fixed it, but I had to reinstall Windows 8.
Justin
17 posts
Including windows.h in my file causes 139 errors
Thats.... what?
The_8th_mage
69 posts / 1 project
Including windows.h in my file causes 139 errors
It may be that you didn't install the windows sdk,or didn't run the cmd file. Installing windows for that problem alone is something that requires a lot of guts.
xel
18 posts
presses plastic buttons for fun
Including windows.h in my file causes 139 errors
I spent a lot of time reinstalling Visual Studio multiple times, reinstalling windows sdk, copying .h files from friends computer into the windows kit folder. I was getting sick of it, and I really wanted to follow the Handmade series.