VS-15 does not compile C ++ projects, what should I do?

documents \ visual studio 2015 \ Projects \ sssssssss \ Debug \ sssssssss.exe "is not recognized as an internal or external command,
an operating program or a batch file.
VS-15 does not compile C ++ projects, what should I do?


1
2
3
4
5
6
7
8
  #include<iostream>
using namespace std;

int main()
{
	cout << "asdf";
	return 0;
}
Have your tried reinstalling VS?
You probably just accidentally messed up some configuration.
I'd just copy the code into a new project, and make sure it's set as a Console Application:
Click on the Project -> [Project Name] Properties -> and in the tab Application, select Output Type: Console Application.


Also what steps are you taking to build the project? Have you tried simply pressing F6? (or F7, depending on the version)
Last edited on
New project I create -File->new-> project->Visual C++ ->win 32 console application.......
Project C # compiles and works only C ++ does not compile ???
Reinstalling Visual Studio works the same way.
The platform is-VS 15 Pro.
Sorry i'm still not exactly sure what you are doing to compile the project? Can you say exactly what buttons/text/keys you're clicking on or pressing?

I'll explain my steps:
1. In my VC15 Pro, I did the same thing, -File->new-> project->Visual C++ ->win 32 console application -> Finish Wizard
2. I now have my TestVC15 solution open, and I copy-paste your OP code into TestVC15.cpp.

3. Then, I keep the menu bar options of "Debug", "x86", and "[Green Triangle play symbol] Local Windows Debugger".

4. I press the "[Green play symbol] Local Windows Debugger", it give a pop-up that says "This project is out of date", click Yes to building it.

5. It gives me an error that says "Unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h'" to your source?

6. Add a line to the top of my .cpp file #include "stdafx.h"

7. Now my code looks like this:
1
2
3
4
5
6
7
8
9
#include "stdafx.h"
#include<iostream>
using namespace std;

int main()
{
	cout << "asdf";
	return 0;
}


8. Press Play button again (Local Windows Debugger).

9. Press Yes to building out-of-date project

10. The program runs successfully (and then immediately closes since I haven't set the console to stay open, see http://www.cplusplus.com/forum/beginner/1988/ for solutions on keeping the console window open)

Tell me if that works, and if not, explain when exactly it stops working. There's an option not to use the pre-compiled headers, but I'm just doing the default configuration without having to change properties.
Last edited on
This is the code in project build in the following wai File->new->project->VC++->Win32conapp->Finish.
// а123.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
using namespace std;

int main()
{
cout << "asdf";
return 0;
}
ahd this is the answer of VS
'"c:\users\ivan andreev\documents\visual studio 2015\Projects\а123\Debug\а123.exe"' is not recognized as an internal or external command,
operable program or batch file.
What kind of OS do you have 32bit or 64bit ?
What is your build target X86 or X64 ?
Hello hamidie,

documents \ visual studio 2015 \ Projects \ sssssssss \ Debug \ sssssssss.exe "is not recognized as an internal or external command,
an operating program or a batch file.

Are you sure that this is a VS problem? I am use to seeing this response from the command prompt when it can not find the file that you have entered.

Something you can try if to follow the above path and delete the ".exe" file and then try under the build menu in the center section it says "clean sssssssss projects" then rebuild the project. I have had a few occasions where I manually have to find and delete the ".exe" and sometimes some of the ".obj" files in both of the "debug" sub directories before it will work.

It is worth a try.

Hope that helps,

Andy
64 bit OS ,X64

Thanks for the tips, I tried everything and there is no change. I just do not know what to do next. VS-compiling C # but not C ++ projects, this is the problem.
Topic archived. No new replies allowed.