#include using namespace std;int main(){cout When shot to run it (after building), I check out the CMD home window flash quickly, and receive the pop up error "Unable to start program, The device cannot discover the record specified"

I've make the efforts building, rebuilding, and also cleaning, there is no result.

You are watching: Visual studio unable to start program the system cannot find the file specified

Thank You.

Edit: thank You for your aid everyone, in the end my trouble was that I opened the .cpp document wrong. (with ctrl n), and also did no left click on the ideal sidebar and also open a brand-new .cpp paper through there.


12 comments
share
save
hide
report
100% Upvoted
This object is archived
New comments cannot be posted and also votes cannot be cast
Sort by: best


*

level 1
· 2y
Are you sure it compiled successfully?


3
Share
ReportSave
level 1
· 2y

Experiment #1: shot replacing system("pause") v system("cmd /c pause")

Experiment #2: try replacing system("pause") with getchar()


3
Share
ReportSave
level 2
· 2y

get char would work, ns pretty sure the problem is visual studios or his anti virus staying clear of the usage of the device command, together it thinks it’s a threat


1
Share
ReportSave
level 1
· 2y · edited 2y

You could shot checking your executable path/output path


1
Share
ReportSave
level 2
OP · 2y

How perform I go around doing so?


1
Share
ReportSave
Continue this thread 


level 1
Comment turned off by user · 2y
level 2
· 2y
It's a typical function.


2
Share
ReportSave
Continue this thread 


level 1
· 2y
Its probably loading part runtime dynamically. How are girlfriend compiling (release/debug). Exactly how are girlfriend linking come vcruntime (dynamic/static)?


1
Share
ReportSave
level 1
· 2y

make pause in all caps


1
Share
ReportSave
level 1
· 2y · edited 2y

short answer: visual studios/antivirus doesn’t like the system pause command.

If girlfriend click “Start without debugging”, or Ctrl + f5, you will have the ability to see your regime run, if you comment the end or remove the pause statement. (just for this reason you have the right to feel some joy from it finally running)

The pause statement is whats offering you the trouble, It’s not really an excellent practice and there’s problems with utilizing it with Visual Studios and/or her anti virus. Your anti virus might see it as a threat because the code is calling the device to pause (not a c++ code). World just teach that to beginners for teaching sake.

See more: Water In A Cup Of Water Pictures, How To Put Water Into An Upside

You deserve to read more about your concern here:

https://stackoverflow.com/questions/1107705/systempause-why-is-it-wrong

also, while ns was spring up that link, I found the video you’re coding follow me with, i believe. Lol https://youtu.be/W8SAPr52yxo


1
Share
ReportSave
level 1
· 2y

Check your antivirus event history. Some antivirus can really aggressive and automatically delete false positives there is no notification.


1
Share
ReportSave
level 2
· 2y

His anti virus is preventing the use of the mechanism command as it thinks it’s a risk is mine view. Not sure why rather downvoted you, ns agree!


1
Share
ReportSave
More write-ups from the cpp_questions community
Continue searching in r/cpp_questions


r/cpp_questions
a suballisonbrookephotography.com for c++ questions and also answers
48.5k
Members


95

Online


Created jan 15, 2012
Join
*
*
*
*

*

Top posts october 30th 2019Top articles of october, 2019Top posts 2019
helpallisonbrookephotography.com coinsallisonbrookephotography.com premiumallisonbrookephotography.com gifts
aboutcareerspressadvertiseblogTermsContent policyPrivacy policyMod policy
Back to Top