C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 08-21-2006, 04:31 AM   #1
Codigious
 
FingerPrint's Avatar
 
Join Date: Mar 2006
Posts: 60
windows.h no such file or directory

I am working on getting a new compiler and the one im looking at is MVC(not sure if the ++ are included on the end lol). Anyways, my current compiler is Dev 4.9.2 and it compiles and runs my program just fine. But when I moved the code over to the MVC and tried it, it didnt work. I got the same error multiple times. So then I downloaded Platform SDK and added in the lib,bin and include files I was supposed to. I also changed a line of code that had kerbel.lib or something like that on it(which I was supposed to do). And I still cant get it to work.

here is the error message:

Code:
 fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
This is how I used it in the actual code:

Code:
#include <iostream>
#include <windows.h>
I tried changing windows.h to windows and that didnt work either. So im nnot really sure wat else to do. If someone could explain to me why it doesnt work and/or how to fix it that would be great.
__________________
Code:
/* ------------------------------------------------------------------*/
                           // INSERT CODE HERE
/* ------------------------------------------------------------------*/

Last edited by FingerPrint; 08-21-2006 at 04:46 AM.
FingerPrint is offline   Reply With Quote
Old 08-21-2006, 05:10 AM   #2
Registered User
 
Join Date: Aug 2005
Posts: 1,265
did you follow all the installation steps ?
Ancient Dragon is offline   Reply With Quote
Old 08-23-2006, 07:39 PM   #3
Codigious
 
FingerPrint's Avatar
 
Join Date: Mar 2006
Posts: 60
I didn't see step 5 the first time through(I was in a hurry and didnt scroll down that far). Anyways, I commented out the for lines that it says t comment out. Then it says:

Code:
From the File menu, click New Project. In the New Project dialog box, 
expand the Visual C++ node in the Product Types tree and then click 
Win32. Click on the Win32 Console Application template and then give 
your project a name and click OK. In the Win32 Application Wizard 
dialog box, make sure that Windows application is selected as the 
Application type and the ATL is not selected. Click the Finish button 
to generate the project.
Code:
In the Win32 Application Wizard dialog box, make sure that Windows 
application is selected as the Application type 

/* On this part it wont let me select windows application. 
Only console application. */
I did exactly what it said but cant finish it because I cant make a windows app. And I have no idea why I cant.
__________________
Code:
/* ------------------------------------------------------------------*/
                           // INSERT CODE HERE
/* ------------------------------------------------------------------*/
FingerPrint is offline   Reply With Quote
Old 08-23-2006, 07:49 PM   #4
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,617
If you were in a hurry then, double check now if you have the needed paths on the include list.
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is offline   Reply With Quote
Old 08-24-2006, 04:27 PM   #5
Codigious
 
FingerPrint's Avatar
 
Join Date: Mar 2006
Posts: 60
Well, I'm glad you said that mario. I did add the paths I was supposed to add, but I added all 3 of them into the executables. I fixed that part. But I still got the error when I ran my program, and I still cant make a windows app. I still can only make a console app.

I also just noticed another thing. On the page Ancient Dragon pointed out says to comment out lines 441-444

Code:
// WIN_APP.disabled = true;
// WIN_APP_LABEL.disabled = true; 
// DLL_APP.disabled = true; 
// DLL_APP_LABEL.disabled = true;

in C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\103 3. I went there, opened the file in Notepad(it mentioned opening it in a text editor) and looked for the 4 lines. Well, I only found these 3 lines.

Code:
// WIN_APP.disabled = true;
// DLL_APP.disabled = true;
// LIB_APP.disabled = true;
So, should I just replace the 3 lines I have with the 4 lines it says should be commented out. Or could this really screw up the program?

EDIT: Ok cool. I found the 4 lines. I didnt notice them the first few searches. But I just found them and commented them out. Its working a'ok now.


RE-EDIT!: Bah! Ok, I thought it was working but unfortunately it isnt. I can now make windows apps and dll's. Yet it still says that there is no winows.h. I just dont get it, ive done all the install steps. All the other headers work just fine. I dont know what else to do from here. It works just fine in Dev C++. Is there some stupidly obvious lib im supposed to add or something?
__________________
Code:
/* ------------------------------------------------------------------*/
                           // INSERT CODE HERE
/* ------------------------------------------------------------------*/

Last edited by FingerPrint; 08-24-2006 at 04:43 PM.
FingerPrint is offline   Reply With Quote
Old 08-24-2006, 07:34 PM   #6
Codigious
 
FingerPrint's Avatar
 
Join Date: Mar 2006
Posts: 60
Well, I did a google search and it seems a ton of people are having this problem. Ill keep working at it but I think I might as well go back to Dev C++ or find some other compiler. Thanks for the help though.
__________________
Code:
/* ------------------------------------------------------------------*/
                           // INSERT CODE HERE
/* ------------------------------------------------------------------*/
FingerPrint is offline   Reply With Quote
Old 08-26-2006, 08:17 PM   #7
Registered User
 
Join Date: Aug 2006
Posts: 61
Allright, I think I figured out the problem; It is with microsoft's website itself; The paths that they provide are inaccurate; It says:

Code:
Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.

Add the paths to the appropriate subsection:

Executable files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin

Include files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

Library files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib
But it should actually say:

Code:
Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.

Add the paths to the appropriate subsection:

Executable files: C:\Program Files\Microsoft Platform SDK\Bin

Include files: C:\Program Files\Microsoft Platform SDK\Include

Library files: C:\Program Files\Microsoft Platform SDK\Lib
At least that worked for me; But if that doesn't work for you, all you have to do is when you are adding a path, instead of copying and pasting the path, click on the "..." button at the end of the box and then browse to the directory that Microsoft PSDK is saved at, then doubleclick on "Bin", "Include", or "Lib" depending on what path you are changing; This should work;
mkylman is offline   Reply With Quote
Old 08-26-2006, 08:35 PM   #8
Registered User
 
Join Date: Aug 2006
Posts: 61
The #include <windows.h> not working problem...SOLVED!

Okay, I have noticed a lot of people having this problem(myself included), on this board, and all accross google; I think that I have discovered the error though; The error is with microsoft's "using platform sdk with visual c++" instruction page, which is located at http://msdn.microsoft.com/vstudio/ex...k/default.aspx; The paths that they provide are inaccurate; It says:

Code:
Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.

Add the paths to the appropriate subsection:

Executable files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin

Include files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

Library files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib
But this is incorrect; It should actually say:

Code:
Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.

Add the paths to the appropriate subsection:

Executable files: C:\Program Files\Microsoft Platform SDK\Bin

Include files: C:\Program Files\Microsoft Platform SDK\Include

Library files: C:\Program Files\Microsoft Platform SDK\Lib
If that doesn't work for you, all you have to do is when you are adding a path, instead of copying and pasting the path, click on the "..." button at the end of the box and then browse to the directory that Microsoft Platform SDK is saved at, then doubleclick on the folder named "Bin", "Include", or "Lib", depending on what path you are changing; This worked for me, so chances are it will also work for you;
mkylman is offline   Reply With Quote
Old 08-26-2006, 09:20 PM   #9
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 11,275
Interesting. I installed Platform SDK, and the correct path is what is given by Microsoft's directions. Which version of the PSDK did you download and install?
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is offline   Reply With Quote
Old 08-26-2006, 09:42 PM   #10
Registered User
 
Join Date: Aug 2006
Posts: 61
Quote:
Originally Posted by laserlight
Interesting. I installed Platform SDK, and the correct path is what is given by Microsoft's directions. Which version of the PSDK did you download and install?
the at this address http://www.microsoft.com/downloads/d...displaylang=en
mkylman is offline   Reply With Quote
Old 08-26-2006, 09:49 PM   #11
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 11,275
Then you probably downloaded the old version. The new version is also linked to from there, under the "Related Resources" section.
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is offline   Reply With Quote
Old 08-26-2006, 09:51 PM   #12
Registered User
 
Join Date: Aug 2006
Posts: 61
Ah...Oh, well then I should prolly see about deleting this thread... God, I feel a little dumb now...Lol;
mkylman is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Writing Problem polskash C Programming 3 02-13-2009 10:47 AM
Inventory records jsbeckton C Programming 23 06-28-2007 04:14 AM
airport Log program using 3D linked List : problem reading from file gemini_shooter C Programming 3 03-04-2005 02:46 PM
archive format Nor A Brief History of Cprogramming.com 0 08-05-2003 07:01 PM
Need a suggestion on a school project.. Screwz Luse C Programming 5 11-27-2001 02:58 AM


All times are GMT -6. The time now is 08:26 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22