I am using Visual C++ 2008 express edition. When I make a new program, I go to win32 and click new console application, but when I put this in:
#include <iostream>//
int main()
{
std::cout <<"Welcome to C++\n";
return 0;
}
And then I press the little play button, it says that it is out of date and asks me if I want to build it. If I say yes, it says it encountered build errors and asks me if I would like to run it from last succesful build. If I press no, nothing happens, but if I press yes it goes to an error message that says that the system could not find the file specified. If I press no when it asks if I want to build it, it goes straight to this message. Please help.
Oh, I remembered, sorry.
Don't use Win32Console Application.
Use Empty Project when you create a new project. And then from the solution explorer add a new .cpp file and write your code there.
If you change what already exists from the Win32Console Application (the one that opens when you create the project) then it doesn't compile... (At least i don't know how to make it compile...)
So it is better if you just want to do some experiments and learn, to use the Empty Project...
Try first to use Build Solution (F7).
Go to your project folder and find out if the file that it is trying to find does exist (it is the executable file).
Press Alt+F7 to open the project properties. Click on the Configuration Properties from the list at the left and then from the top right side the Configuration Manager. And check to be in Debug and the build checkbox on.
Thats why you hve to click fro the left list the Configuration Properties, so they will be enabled. If you have selected Common Properties, they are Gray...
I use Visual Studio 2008 Professional, and under the Build menu there is an option for "Clean solution". Try clicking that before you build it. Sometimes files get corrupted in your build and the thing needs to be built from scratch.