Microsoft Visual Studio:the file cannot be found when running the program

LtpLGM 1 Reputation point
2022-04-10T07:21:22.217+00:00

After the compilation is successful, the file cannot be found when running the program.
在编译成功后,运行时找不到文件。

Display:(Chinese)

Microsoft Visual Studio

无法启动程序“C:\Users\1vr_s\Desktop\passward\Project1\x64\Debug\Project1.exe”。

系统找不到指定的文件。

确定

Display:(English)

Microsoft Visual Studio

Unable to start program

The system cannot find the specified file.

determine

191520-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-04-10-150715.png

Developer technologies | C++
Developer technologies | Visual Studio | Other
{count} votes

1 answer

Sort by: Most helpful
  1. YujianYao-MSFT 4,296 Reputation points Microsoft External Staff
    2022-04-11T07:47:58.817+00:00

    Hi @LtpLGM ,

    I have two thoughts on your problem:

    1.When using the method in the figure to add the project file debug, the program cannot be started, and the system cannot find the specified path. Since the .cpp file newly created in this path does not contain the project directory, the compiler cannot find the file, so the above error occurs.

    191746-error.png

    You should create a .cpp file in the project directory in the Solution Explorer, the steps are as follows.

    191770-right.png

    2.Whether your computer has 360 or other similar antivirus software installed, I have encountered this error caused by 360. Try uninstalling 360 and recreating the project.

    Best regards,

    Elya


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

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.