project .exe file is not recognized as an iternal or external command?

To be fair, I don't know what exactly is going wrong here, but the information I can provide is two things: I was following a tutorial, which had me create a windows 32 console application, and I noticed mine had stdafx.h and other header files that was not appearing on the tutorial and not being used so I deleted them. The other info was that after deleting them, I had to set my program to not use precompiled headers, after which the window started up saying it wasn't recognizing the main cpp file as an internal or external command. This was a tutorial using OpenGL if that means anything towards this
Last edited on
It may be easier to create a new project using the wizard, then copy your source files in.

Until you fully understand what you're doing, it may be best to leave in stdafx.h.
Hello moosyman,

I would guess that you are using some version of Visual Studios for your IDE. When you let VS create a project with the "new Project Wiard" it creates the files "stdafx.h" and "targetver.h" and needs both these files to work. The wizard will put "stdafx.h" in the main file for you and any other .cpp files you create will need "stdafx.h" included at the beginning of the program. This is specific to VS.

The only exception to this is when the second window of the wizard appears choose next and check "empty project" box before pressing "finished" then you can copy the program directly from the book with out any problems running the program either in debug or release mode.

Set the IDE back to using "precompiled headers" and it should work. If not let me know and I will see what we can figure out.

Hope that helps,

Andy
you can get rid of stdafx but you have to do it carefully. For now, if putting it back like it was does not fix it, you may want to just make a new project and paste the code into the new one. Get it working, back it up, then play with the project settings and all. I always used to remove precompiled headers and stdafx but at that time, they caused instability. I think its been fixed in the current versions.
@Handy Andy
So I don't know what I did differently, but I did make another windows 32 console application, and this time stdafx.h wasn't included but it ran just fine. Again, I don't know what to say the solution is to my problem because I'm fairly certain I created an exact copy.
Topic archived. No new replies allowed.