Sign in to follow this  

How do I get "windows.h" header?

This topic is 3845 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

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()....

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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().

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3845 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this