Lỗi the system cannot find the file specified trong c++

-

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

Bạn đang xem: Lỗi the system cannot find the file specified trong c++

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...

*

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.

Xem thêm: Fix Lỗi Không Tạo Được New Folder Win 7, Không Tạo Được New Folder Win 7

*


c++
codeideerror2.png (64.4 KiB)
codeideerror.png (76.5 KiB)
Comment
Comment · Show 1
Comment
5 |1600 characters needed characters left characters exceeded
▼ Toggle Comment visibility. Current Visibility: Visible to all users

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


*
SimpleSamples · Jul 18, 2021 at 05:08 PM

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 ·

2 Answers



Click to vote 2 Votes" 2 Click to down vote
Viorel-1 answered • Jul 18, "21 | Viorel-1 edited • Jul 18, "21

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.


Comment
Comment Show 0
Comment
5 |1600 characters needed characters left characters exceeded
▼ Toggle Comment visibility. Current Visibility: Visible to all users

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


*

Click to vote 0 Votes" 0 Click to down vote
IsaacTait-9448 answered • Jul 18, "21

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!


Comment
Comment Show 0
Comment
5 |1600 characters needed characters left characters exceeded
▼ Toggle Comment visibility. Current Visibility: Visible to all users

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


question details


8 people are following this question.


*
*
*
*
*
*

Answers Subscribe to Answers Answers and Comments Subscribe to Comments and Answers

Related Questions


MFC C++ application: how to clear command line arguments in Task Manager?