简体   繁体   English

视觉工作室。 无法启动程序 '' 系统找不到指定的文件

[英]Visual Studio. Unable to start program '' The system cannot find the file specified

Its my first program on Visual Studio on C#.它是我在 C# 上的 Visual Studio 上的第一个程序。 I did not write my own code and Im trying to open any template projects with simple console writes.我没有编写自己的代码,我试图通过简单的控制台写入打开任何模板项目。

// ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file


However Im receiving error that I do not know how to solve.但是我收到错误,我不知道如何解决。

Errors: Unable to build properly.错误:无法正确构建。 When I try to build, there are tons of errors eg cannot open source file ... (tons of this) the global scope has no .... (tons of this)当我尝试构建时,有很多错误,例如无法打开源文件......(大量)全局范围没有......(大量)
And when I try to run, obviously it wont run.当我尝试运行时,显然它不会运行。 It will tell me "Unable to start program. 'C:\\repo....\\Debug\\ConsoleApplication1.exe' The system cannot find the file specified."它会告诉我“无法启动程序。'C:\\repo....\\Debug\\ConsoleApplication1.exe'系统找不到指定的文件。”

This is my very first program and Im unable to run it.这是我的第一个程序,我无法运行它。 I believe its probably due to file path of the project - unable to find the appropriate files.我相信这可能是由于项目的文件路径 - 无法找到合适的文件。 I have no idea which setting to tweak as well... Probably a very simple solution but I cant find it online.我也不知道要调整哪个设置......可能是一个非常简单的解决方案,但我无法在网上找到它。 Thanks.谢谢。

According to your example code, this is a C ++ project and not a C # project.根据您的示例代码,这是一个 C++ 项目而不是 C# 项目。 If you want to create a C# project ,you need different code.如果要创建 C# 项目,则需要不同的代码。

If you created a c++ project, and got this error.如果您创建了一个 C++ 项目,并收到此错误。 I sugges you could follow the following steps to resolve the issue:我建议您可以按照以下步骤解决问题:

1,You should build the project before running it. 1,您应该在运行之前构建项目。

The cause of this error is most likely because you haven't built your project from Build > Build Solution .此错误的原因很可能是因为您尚未从Build > Build Solution构建您的项目。 The reason you're getting this error when you try to run your project is because Visual Studio can't find the executable file that should be produced when you build your project.尝试运行项目时出现此错误的原因是 Visual Studio 找不到生成项目时应生成的可执行文件。

2,Check if the linker output file matches the path, name and extension of the target file. 2、检查链接器输出文件是否与目标文件的路径、名称和扩展名匹配。

Right Click Project Name > Properties -> Linker > General -> Output File > $(OutDir)$(TargetName)$(TargetExt)右键单击项目名称 > 属性 -> 链接器 > 常规 -> 输出文件 > $(OutDir)$(TargetName)$(TargetExt)

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio:无法启动程序,系统找不到指定的文件 Visual Studio 错误? - Visual Studio: Unable to start program, the system cannot find the file specified visual studio error? Visual Studio2012。“无法启动程序” * .exe“找不到指定的文件” - Visual Studio 2012. “unable to start program” *.exe “cannot find the file specified” 错误:无法启动程序“*.exe”系统找不到指定的文件 - Error: unable to start program "*.exe" the system cannot find the file specified Visual Studio 调试器错误:无法启动程序 找不到指定文件 - Visual Studio debugger error: Unable to start program Specified file cannot be found 无法启动程序VS2015 | 访问被拒绝| 系统找不到指定的文件 - Unable to start program VS2015 | Access denied | system cannot find the file specified 无法启动“program.exe” 系统找不到vs2008指定的文件 - unable to start "program.exe" the system cannot find the file specified vs2008 无法启动程序:系统找不到指定的文件。 (C ++ BTW) - Unable to Start Program: The system cannot find the file specified. (C++ BTW) C ++错误:“无法启动程序&#39;filepath.exe&#39;,系统找不到指定的文件 - C++ error: "Unable to start program 'filepath.exe' The system cannot find the file specified “+1 超载 --- Function 未找到“...”的定义”以及“无法启动程序。系统找不到指定的文件” - "+1 Overload --- Function definition for '...' not found" Along With "Unable to start program. The system cannot find the file specified" Visual Studio - Imread 系统找不到指定的文件 - Visual Studio - Imread system cannot find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM