How do I get "windows.h" header?

Started by
8 comments, last by Shakedown 16 years, 10 months ago
So I've read that I need to download the Visual C++ 2005 Express Edition Microsoft Platform SDK R2. So I downloaded PSDK-x86.exe and went to setup, but it gives me a huge list of...stuff...to choose from (when I went to Custom install), and I don't want to install 966MB of garbage. So what do I need to install so I have "windows.h" so I can use...Sleep() for example...god all this for Sleep()....
Advertisement
Follow the instructions that were on the page after you downloading VC++ Express. Failing that, simply install the standard install. The SDK is big, you don't want to try to manually pare it down because you'll end up with missing files -- you need much more than windows.h to actually do anything with the Win32 API.
Quote:Original post by jpetrie
Follow the instructions that were on the page after you downloading VC++ Express. Failing that, simply install the standard install. The SDK is big, you don't want to try to manually pare it down because you'll end up with missing files -- you need much more than windows.h to actually do anything with the Win32 API.


I guess I should have mentioned that im not using Win32 API at all, I just want my basic C++ program to be able to Sleep().
Well, sleep is part of the Win32 API so, yeah. What sleep does is, it allows other threads to execute. C++ doesn't really have any concept of threads. If you just want to pause for a few moments then you could use the clock function to cause a delay. Heck, that page even gives an example on how to produce a delay. The problem with such a delay is that your program will not give up CPU time without a fight while sleep does.

That said, let me reiterate my first point: sleep is part of the win32 API and you either get all of it or none of it, not a part of it.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

Quote:Original post by nobodynews
That said, let me reiterate my first point: sleep is part of the win32 API and you either get all of it or none of it, not a part of it.


Damn. I guess there will be no Sleep()...hah
Keep in mind that you will need the platform SDK to do most things outside the realm of console applications...

So if you ever decide to work with DirectX or anything in C++ then you will need to install the SDK anyway..

Only the relevant parts will be included in your EXE so really you just need to install it to your machine.

Really with the size of modern hard drives, installing 900 megs shouldn't be that huge of a concern?
Quote:Original post by shadowisadog
Keep in mind that you will need the platform SDK to do most things outside the realm of console applications...

So if you ever decide to work with DirectX or anything in C++ then you will need to install the SDK anyway..

Only the relevant parts will be included in your EXE so really you just need to install it to your machine.

Really with the size of modern hard drives, installing 900 megs shouldn't be that huge of a concern?


You're right, and I realize that. I'm just not going to be doing anything other than console applications for a bit so I don't want to bother with it, although I'm sure I'll eventually give in and install the whole thing just so I can use Sleep()...haha

But thank you everyone for your help
Even if you plan to stay in console mode 'for a bit', what would the harm be of having the sdk installed now?
Follow step 3/4/5 here and you should be good to go
Quote:Original post by trick
Even if you plan to stay in console mode 'for a bit', what would the harm be of having the sdk installed now?


Ha nothing really, I'm just kinda anal about downloading and installing things that I don't ABSOLUTELY need.

This topic is closed to new replies.

Advertisement