Jump to content

  • Log In with Google      Sign In   
  • Create Account


Windows.h missing ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
11 replies to this topic

#1 Jeffreyp   Members   -  Reputation: 178

Like
0Likes
Like

Posted 14 April 2011 - 01:09 PM

Hello all,

Today i decided to start programming with DirectX 11, so i downloaded the latest sdk(i had the one from february 2010)
and installed it. I opened an example project and tryed to compile it, but to my suprise i get a compiler error saying that windows.h cannot be found.
Before i installed the latest sdk everything was fine.

btw im using visual studio 2008.

thanks in advance

Sponsor:

#2 kiwibonga   Members   -  Reputation: 170

Like
0Likes
Like

Posted 14 April 2011 - 01:36 PM

Are you by any chance #including "Windows.h" instead of <Windows.h> ?

#3 Jeffreyp   Members   -  Reputation: 178

Like
0Likes
Like

Posted 14 April 2011 - 01:42 PM

Are you by any chance #including "Windows.h" instead of <Windows.h> ?


Nope im including <Windows.h>
Mabye the installation messed up my settings?
Is it bad to have 3 different versions of the SDK installed?
Because i got the 2007, 2010(february) and 2010(june) versions.

Thanks

#4 ExcessNeo   GDNet+   -  Reputation: 421

Like
0Likes
Like

Posted 14 April 2011 - 05:30 PM

Have you got the platform sdk?

Windows.h isn't included in Visual Studio express edition installations so that could be your problem (if you are using the express edition that is).



#5 Jeffreyp   Members   -  Reputation: 178

Like
0Likes
Like

Posted 14 April 2011 - 11:56 PM

Have you got the platform sdk?

Windows.h isn't included in Visual Studio express edition installations so that could be your problem (if you are using the express edition that is).



I tryed to install the latest version of the platform SDK,
but it didnt solve my problem.

Edit : Im using the Visual Studio 2008 Professional Edition.

#6 frob   Moderators   -  Reputation: 19010

Like
0Likes
Like

Posted 15 April 2011 - 10:52 AM

but to my suprise i get a compiler error saying that windows.h cannot be found.
Before i installed the latest sdk everything was fine.


There are known issues with various versions of SDKs being used with various versions of IDEs where they stomp on each other's configured paths.

You can either modify the search paths to use whatever you expected, or download and install the latest Windows SDK, which should again update the search paths and include itself. I suggest you use the latest version of the SDK unless you have a compelling reason not to.
Check out my personal indie blog at bryanwagstaff.com.

#7 Jeffreyp   Members   -  Reputation: 178

Like
0Likes
Like

Posted 15 April 2011 - 12:39 PM


but to my suprise i get a compiler error saying that windows.h cannot be found.
Before i installed the latest sdk everything was fine.


There are known issues with various versions of SDKs being used with various versions of IDEs where they stomp on each other's configured paths.

You can either modify the search paths to use whatever you expected, or download and install the latest Windows SDK, which should again update the search paths and include itself. I suggest you use the latest version of the SDK unless you have a compelling reason not to.


I already got the latest Platform SDK / DirectX SDK, but im using Visual studio proff 2008.
So i have to switch to Visual studio 2010?

btw i tried a repair on visual studio 2008 and it didnt work.

#8 AndyWonHarglesis   Members   -  Reputation: -202

Like
-1Likes
Like

Posted 15 April 2011 - 02:13 PM



but to my suprise i get a compiler error saying that windows.h cannot be found.
Before i installed the latest sdk everything was fine.


There are known issues with various versions of SDKs being used with various versions of IDEs where they stomp on each other's configured paths.

You can either modify the search paths to use whatever you expected, or download and install the latest Windows SDK, which should again update the search paths and include itself. I suggest you use the latest version of the SDK unless you have a compelling reason not to.


I already got the latest Platform SDK / DirectX SDK, but im using Visual studio proff 2008.
So i have to switch to Visual studio 2010?

btw i tried a repair on visual studio 2008 and it didnt work.


1.Are you absolutely positive that the <windows.h> file is in your hard drive and existing?

2.Are you sure that all libs, dlls and such related to <windows.h> are existing?

3.Did you check and see because some DirectX headers already include <windows.h> or maybe the compiling is confused by some related issue to that.

4.I can't really be the best judge because I don't use Visual Studio anymore... I use Code::Blocks, Bloodshed Dev, C++ mainly.

5.Is the windows.h file in the directory from which the preprocessor reads from? The file must be in the includes folder of your Visual Studio folder because that's where the #includes/header files and such are read from. Check and see if windows.h is there along with all of its other sub-headers, dlls and lib files.

Any slight error can make the compilation fail if the preprocessor can't find the file because it's misplaced or missing necessary things associated with it to function properly.

The externs, dlls and lib files must be working in full accordance with the main windows header file. If not, then it won't work. But the issue you seem to be having is likely due to the fact that the main windows header file is not in the include folder/directory where the preprocessor reads from.

Thus, "Cannot find <windows.h>. No such file exists.".

Also, not to sound too picky, but everything is case-sensitive. If you capitalize it then it may not work, but that's usually not the case.

Check all spelling to assure perfect syntax and everything in the #include for windows header file as well.

#9 Jeffreyp   Members   -  Reputation: 178

Like
1Likes
Like

Posted 15 April 2011 - 03:02 PM

1.Are you absolutely positive that the <windows.h> file is in your hard drive and existing?

Yes, because if i compile it with Dev-C++ it works fine.

2.Are you sure that all libs, dlls and such related to <windows.h> are existing?

Yes, because they existed before too.

3.Did you check and see because some DirectX headers already include <windows.h> or maybe the compiling is confused by some related issue to that.

When i try to compile a simple hello world program it gives the same error. So it isnt DirectX.

4.I can't really be the best judge because I don't use Visual Studio anymore... I use Code::Blocks, Bloodshed Dev, C++ mainly.

On dev c++ it compiles fine.

5.Is the windows.h file in the directory from which the preprocessor reads from? The file must be in the includes folder of your Visual Studio folder because that's where the #includes/header files and such are read from. Check and see if windows.h is there along with all of its other sub-headers, dlls and lib files.

No it isnt there. And after i see im missing alot more headers like <vector>.
So i already tried a repair but it didnt give me the headers back.
I guess its an issue with the compiler working with the SDK?

#10 AndyWonHarglesis   Members   -  Reputation: -202

Like
-1Likes
Like

Posted 15 April 2011 - 03:19 PM

No it isnt there. And after i see im missing alot more headers like <vector>.
So i already tried a repair but it didnt give me the headers back.
I guess its an issue with the compiler working with the SDK?


If you're missing the header files then that pretty much explains exactly what the problem is.

That IDE didn't bring the header files? Trash it and get another one, specifically a newer one.

That should solve the case. Make sure you completely remove all of the files relating to your current IDE before downloading the newer one.

Try that and tell me how it goes.

But yes, it could also have to do with the compiler. Which one do you use?

All in all, getting a newer IDE or using a different one will solve your problem.

It obviously works on other IDEs because they contain the header files, libs and all other necessary files to run the Windows API.

The IDE you were failing to get it running on was missing the files.

Hence, use another IDE with all of the optimum Windows files for the Windows API language and environment because getting all the files together yourself, one by one, will be a pain and there will likely be countless errors.

Logic number one: If you want to use something and it doesn't exist then you can't use it.

Research and re-learn.

#11 Jeffreyp   Members   -  Reputation: 178

Like
0Likes
Like

Posted 16 April 2011 - 05:28 AM

I uninstalled visual studio 2008 proffesional and
installed visual studio 2010 proffesional and the problem is solved.

Thanks everyone

#12 AndyWonHarglesis   Members   -  Reputation: -202

Like
-2Likes
Like

Posted 16 April 2011 - 04:42 PM

I uninstalled visual studio 2008 proffesional and
installed visual studio 2010 proffesional and the problem is solved.

Thanks ?? >> "everyone" << ??


You're welcome! ;)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS