question

IsaacTait-9448 avatar image
0 Votes"
IsaacTait-9448 asked IsaacTait-9448 answered

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

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


c++
codeideerror2.png (64.4 KiB)
codeideerror.png (76.5 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am not sure what directory the main.cpp file is in but you can right-click Source File in the Solution Explorer then select "Add.." then "existing Item" then add main.cpp. In the future you can create a C++ project in the same way you did but then you can right-click Source File in the Solution Explorer then select "Add.." then "new Item" and that will create an empty cpp file.

1 Vote 1 ·
Viorel-1 avatar image
3 Votes"
Viorel-1 answered Viorel-1 edited

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 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IsaacTait-9448 avatar image
0 Votes"
IsaacTait-9448 answered

When I created the project I went to File -> New -> File instead of the way @SimpleSamples 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-1 for pointing out my error. I am getting it sorted out now. Cheers!


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.