Visual Studio 2019 Unable to start program, the system cannot find the file specified

Isaac Tait 21 Reputation points
2021-07-18T04:08:16.47+00:00

I am having a similar issue as this post. However, on build I have 0 errors, 0 warning, and 0 messages.

I took a look at Project -> Properties but I do not seem to have a linker option (which appears to be a typical fix that others have used to solve this issue).

I have also tried Rebuilding Solution and then running but that does not seem to work either...

115580-codeideerror2.png

Based on the aforementioned similar issue I understand the premise that "when an exe cannot be created (or in my case - found)... then naturally it cannot be run as it does not exist". However, I do not understand where the disconnect is occurring that is preventing this file from either being found or created...

Any help sorting this out would be greatly appreciated. Cheers.

115651-codeideerror.png

Developer technologies | C++
{count} votes

Accepted answer
  1. Viorel 122.6K Reputation points
    2021-07-18T05:36:01.533+00:00

    It seems that you created an empty project and main.cpp is not included into project.

    Try creating a new “Console App” project, check that it runs, then add your code. It is possible to add existing files too.

    5 people found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Isaac Tait 21 Reputation points
    2021-07-18T17:15:34.34+00:00

    When I created the project I went to File -> New -> File instead of the way @Sam of Simple Samples suggested. Here is some documentation on how to do it correctly (both for myself and for anyone else who comes across this in the future). Thank you @Viorel for pointing out my error. I am getting it sorted out now. Cheers!

    0 comments No comments

  2. slipbits 16 Reputation points
    2022-11-12T20:55:23.707+00:00

    I have a similar problem. My builds/rebuilds have 0 errors/0 warnings. The code has been built correctly, or errors fixed, and built for 5+ months. My main file has a main in it, unchanged for 5+ months. My Debug directory has an .exe in it. My object file directory, <program name>/Debug has .obj files in it but no .exe file. I have no external libraries that I link to.

    I have done a clean and build/rebuild.

    I have looked at previous posts. I have checked my Tools->Options and I seem to have all of the posted options set.

    I don't know what else to do. Does anyone know how to fix this?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.