Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Is windows.h header file available in Visual C++? If not where can I get it, can it be downloaded?
Posted
Updated 14-Sep-13 14:08pm
v3
Comments
[no name] 14-Sep-13 0:43am    
Have you tried #include "windows.h"?
Sergey Alexandrovich Kryukov 14-Sep-13 1:05am    
No, it should be:
#include <windows.h>

I answered, please see.
—SA
[no name] 14-Sep-13 1:24am    
I deliberately began with the more general. As yet OP is silent.
Sergey Alexandrovich Kryukov 14-Sep-13 20:05pm    
I did not get it. None of the variants is more general than another, only in Visual Studio standard settings angular brackets actually work, as always with standard libraries...
—SA
[no name] 14-Sep-13 20:23pm    
You are correct if the libraries and headers are in the right location. Using quotations will cause the compiler to look in more directories. I agree it would not have helped in this case but it is a small point as I was merely trying to assist the Op to find the header.

1 solution

It is available, but this is not just the include file.

Including a header file itself does not make libraries accessible. You also need to link them. With Visual Studio, you can set all appropriate options (in particular, telling the compiler and the linker to look for certain files in certain directories) just by using one of the available Win32-related project template. If you create a project from a template, everything will be set for you. Then you can look for linker and compiler options and find out where it what.

Make sure you include the header files correctly. For "windows.h" it should be:
C++
#include <windows.h>
// NOT '#include "windows.h"' as this is a "system" directory


Please see: http://en.wikipedia.org/wiki/Windows.h[^].

—SA
 
Share this answer
 
v2
Comments
CPallini 14-Sep-13 2:43am    
5.
Sergey Alexandrovich Kryukov 14-Sep-13 20:05pm    
Thank you, Carlo.
—SA
CHill60 14-Sep-13 20:37pm    
5
Sergey Alexandrovich Kryukov 14-Sep-13 20:38pm    
Thank you very much.
—SA
H.Brydon 14-Sep-13 20:39pm    
I count 15. :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900