I installed Visual Studio 2010. I wrote a simple code which I"m sure is correct but unfortunately, when I run the code, I get the error below.

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

Here is my code:

#includeusing namespace std;int main (){ cout And here is the error:

Unable lớn start program "C:UsersSoheilDesktopNew foldersamDebugsam.exe The system cannot find the tệp tin specified

Would you help me solve the issue? Should I define the project in aspecific directory? I"ve sầu spent a ton of hours to lớn solve sầu this issue andhave not had any success yet.



This is a first step for sometoàn thân that is a beginner. Same thing happened to me:

Look in the Solution Explorer box to lớn the left. Make sure that there is actually a .cpp file there. You can vị the same by looking the .cpp file where the .sln tệp tin for the project is stored. If there is not one, then you will get that error.

When adding a cpp tệp tin you want to lớn use the Add new item icon. (top left with a gold star on it, hover over it to see the name) For some reason Ctrl+N does not actually add a .cpp file khổng lồ the project.



Encountered the same issue, after downloading a project, in debug mode. Searched for hours without any luông chồng. Following resolved my problem;

Project Properties -> Linker -> Output tệp tin -> $(OutDir)$(TargetName)$(TargetExt)

It was previously pointing khổng lồ a folder that MSVS wasn"t running from whilst debugging mode.

EDIT: soon as I posted this I came across: unable lớn start "program.exe" the system cannot find the tệp tin specified vs2008 which explains the same thing.


I have sầu recently not used VS 2010.

Does your application really build correctly? To get more control in VS 2010 C++ Express, you can check menu thành công "Expert Settings" under Tools>Settings to get a Build" menu.After clicking Build->Build Solution (or Rebuild), you may verify in Output window (View->Outout), if your application is compiling & linking correctly.

Xem thêm: Nhân Duyên Vợ Chồng Là Nghiệp Hay Phước Nhưng Lại Là 'Nợ'

Sources :

Hope it helps.

I know this is an old thread, but for any future visitors, the cause of this error is most likely because you haven"t built your project from 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.

As others have sầu mentioned, this is an old thread & even with this thread there tends lớn be different solutions that worked for different people. The solution that worked for is as follows:

Right Cliông chồng Project Name > PropertiesLinker > General Output File > $(OutDir)$(TargetName)$(TargetExt) as indicated by
ReturnVoidCliông xã ApplyFor whatever reason this initial correction didn"t fix my problem (I"m using VS2015 Community to lớn build c++ program). If you still get the error message try the following additional steps:

Bachồng in Project > Properties > Linker > General > đầu ra File > You"ll see the previously entered text in bold

Select Drop Down > Select "inherit from parent or project defaults"Select ApplyPreviously bold fonts is no longer bold

Build > Rebuild > DebugIt doesn"t make since to lớn me to lớn require these additional steps in addition to lớn what
For me, I didn"t have sầu my startup project mix in Solution Explorer.

Go to lớn Solution Explorer on the left of VS, right click your unit chạy thử project, & choose "mix as startup project".

I had just ported my code khổng lồ a new workspace, và forgot that when I opened the project in VS in the solution there, that I needed to lớn re-set my startup project.

I know this thread is 1 year old but I hope this helps someone, my problem was that I needed lớn add:

#include "stdafx.h"lớn my project (on the first line), this seems lớn be the case most of the time!

I came across this problem and none of these solution worked 100%

In addition lớn ReturnVoid"s answer which suggested the change

Project Properties -> Linker -> Output tệp tin -> $(OutDir)$(TargetName)$(TargetExt)

I needed khổng lồ changed

Project Properties -> C/C++ -> Debug Information Format -> /Zi

This field was blank for me, changing the contents to /Zi (or /Z7 or /ZI if those are the formats you want lớn use) allowed me to debug

I got this problem during debug mode và the missing tệp tin was from a static library I was using. The problem was solved by using step over instead of step inlớn during debugging

if vs2010 installed correctly

kiểm tra tệp tin type (.cpp)

just build it again It will automatically fix,, ( if you are using VS 2010 )

I had a same problem & i could fixed it!you should add C:Program Files (x86)Microsoft SDKsWindowsv7.1ALibx64 for 64 bit system/ C:Program Files (x86)Microsoft SDKsWindowsv7.1ALib for 32 bit system in property manager-> Linker-> General->Additional library Directories

maybe it can solve the problem of somebody toàn thân in the future!

Since this thread is one of the top results for that error và has no fix yet, I"ll post what I found khổng lồ fix it, originally found in this thread: Build Failure? "Unable to lớn start program... The system cannot find the tệp tin specificed" which lead me to this thread: Error 'LINK : fatal error LNK1123: failure during conversion to lớn COFF: tệp tin invalid or corrupt' after installing Visual Studio 2012 Release Preview

Basically all I did is this:Project Properties -> Configuration Properties -> Linker (General) -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"

Highly active question. Earn 10 reputation (not counting the association bonus) in order khổng lồ answer this question. The reputation requirement helps protect this question from spam & non-answer activity.

Not the answer you're looking for? Browse other questions tagged c++ visual-studio or ask your own question.

Unable to start program 'MYPATH.exe'. The system cannot find the tệp tin specified. When i try lớn run a new 'hello world' console application
My C code isn't compiling on Visual Studio 2017 và keeps giving me an error saying it can't find the specific file?
Build Failure? “Unable to lớn start program… The system cannot find the tệp tin specificed”
site thiết kế / biệu tượng công ty © 2021 Staông chồng Exchange Inc; user contributions licensed under cc by-sa. rev2021.8.27.40079

Your privacy

By clicking “Accept all cookies”, you agree Staông xã Exchange can store cookies on your device & discthua information in accordance with our Cookie Policy.