sniperwolf

i have microsoft visual C++ 2005 express edition,i would also like to mention i am new at this,very new,and i am following along with a book called "Beginning Game Programming" by Johnathan S. harbour.i have created a project,set it up the way i belive it should be set up and its a basic program here it is:

// HelloWorld Program

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,

LPSTR lpCmdLine, int cShowCmd)

{

MessageBox(NULL, "All your base are belong to us!",

"Hello World" MB_OK | MB_ICONEXCLAMATION);

}

In the error description box it says <windows.h> isnt found but its listed in the book im using. The error box itself says this: "There were build errors, would you like to continue and run the last succesful build". I then choose "OK" and it says this:  "The system cannot find the file specified". Now iv looked this up and it seems to be error 2 yet i cant find out how to correct the problem. So far this is the only project iv done and i cant get it to work right.Please help me solve my problem, thank's in advance.



Re: Visual C++ General the system cannot find the file specified...error 2

CheckRevision

#include <windows>

try without the ".h"

:)






Re: Visual C++ General the system cannot find the file specified...error 2

Simple Samples

There is nothing wrong with the source code that I see. The problem is nearly certainly that your Visual C++ is not set up properly. VC is not finding windows.h, probably because VC is not looking in the directory that contains windows.h. To verify that, right-click on the text windows.h in the #include. In the context menu, select "Open document <windows.h>" (or something like that). If VC says it can't find windows.h then that supports the error that VC can't find it.

I am not sure what the problem is in terms of what caused VC to get set up improperly. It should have been installed properly so there seems to have been something that was done after installation to cause the problem.

There is a place in the VC options that lists directories to look in for #includes. I don't have convenient access to VC 2005 at the moment, so I can't be sure where to look. Look for that to see if the list of directories includes the directory containing windows.h.






Re: Visual C++ General the system cannot find the file specified...error 2

Simple Samples

CheckRevision wrote:

#include <windows>

try without the ".h"

:)

You are guessing. You should at least say you are guessing. Better yet, it is very easy to verify if that is correct.




Re: Visual C++ General the system cannot find the file specified...error 2

CheckRevision

Simple Samples wrote:
CheckRevision wrote:

#include <windows>

try without the ".h"

:)

You are guessing. You should at least say you are guessing. Better yet, it is very easy to verify if that is correct.

I was using VC++ 6.0 and it works with <windows>






Re: Visual C++ General the system cannot find the file specified...error 2

Jonathan Caves - MSFT

I strongly suspect that the problem here is that the Express Edition does not come with the Platfrom SDK - so windows.h along with all the other Windows header files and libraries are not on the machine. You need to install the PSDK details are here.




Re: Visual C++ General the system cannot find the file specified...error 2

Simple Samples

CheckRevision wrote:
I was using VC++ 6.0 and it works with <windows>
I also have VC 6 and when I use it I get an error when I use #include <WINDOWS>.

I am sorry if I overreacted but you seem to have a modification in your system that allows you to use that include without the .h extension.






Re: Visual C++ General the system cannot find the file specified...error 2

sniperwolf

ok so i downloaded it and it dosnt work, when im working through the installation wizard. I get a messege that says Im already downloading something and i need to finish that before i can start this instalation.Now this cant be true becuase iv restarted my computer and iv checked the task manager but i can find another instalation in progress so i dont know what to do.

*EDIT*

ok so i got the installation at least going, some what, however, this time i cant install because it just stops installing and freezes so it wont continue with the installation process. very aggrivating btw





Re: Visual C++ General the system cannot find the file specified...error 2

Shakje

Is the whole system freezing or just the install How far through is it when it freezes Try leaving it for at least 10-15 minutes to see if it changes at all.




Re: Visual C++ General the system cannot find the file specified...error 2

sniperwolf

No it just freezes the screen and i have tried waiting. However, to no avail. The download stops at about half way.