[英]Visual Studio: Unable to start program, the system cannot find the file specified visual studio error?
Here I'm Using visual studio 2019 community edition.这里我使用的是 Visual Studio 2019 社区版。 I open a folder from file->new->existing project.我从文件->新建->现有项目打开一个文件夹。 But whenever i build and run my program.但是每当我构建和运行我的程序时。 it says它说
Unable to start program 'O:\1.Fourth semester\programminh\main\Debug\Main2.exe' the system cannot find the file specified Unable to start program 'O:\1.Fourth terminh\main\Debug\Main2.exe' 系统找不到指定的文件
There are lots of programs.有很多节目。 like bubble.cpp, binary.cpp but it runs Main2.exe.像bubble.cpp、binary.cpp 但它运行Main2.exe。
Here is my linear.cpp file这是我的 linear.cpp 文件
#include <iostream>
using namespace std;
int main(){
int n, an, arr[30], key, i, found=0;
cout<<"Please enter number of element you want:"<<endl;
cin>>n;
cout<<"Please enter the numbers"<<endl;
for(i=0;i<n;i++){
cin>>arr[i];
}
cout<<"Please Enter the number you want to search"<<endl;
cin>>key;
for(i=0;i<n; i++){
if(arr[i] == key){
cout<<"Element found at position "<<i+1;
found=1;
break;
}
}
if(!found){
cout<<"Number Not Found"<<endl;
}
return 0;
}
Can someone check it out, please?有人可以检查一下吗?
I open a folder from file->new->existing project.我从文件->新建->现有项目打开一个文件夹。
As far as I'm concerned you should open a.sln file instead of a folder.就我而言,您应该打开 a.sln 文件而不是文件夹。
You could only run the.sln file (Visual Studio Solution) not a.cpp file.您只能运行 .sln 文件(Visual Studio 解决方案)而不是 .cpp 文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.