C++ 无法启动“program.exe”系统找不到指定的文件vs2008

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2268478/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:47:29  来源:igfitidea点击:

unable to start "program.exe" the system cannot find the file specified vs2008

c++windows

提问by Dave Powell

I am able to successfully build solution. but i keep getting this when i try to start debugging or executing it. any suggestions why this might be the case?

我能够成功构建解决方案。但是当我尝试开始调试或执行它时,我一直得到这个。有什么建议为什么会这样?

update: i fixed the issue. I just recreated the proj with empty files and then just rebuild and it worked. one question: when i start the program (its a console app) how do i stop it from disappearing when i try to enter any input from within vs2008?

更新:我解决了这个问题。我只是用空文件重新创建了项目,然后重新构建它就可以了。一个问题:当我启动程序(它是一个控制台应用程序)时,当我尝试从 vs2008 中输入任何输入时,如何阻止它消失?

thanks

谢谢

回答by Adam Holmberg

Make sure the debug command

确保调试命令

(Properties > Configuration Properties > Debugging > Command)

(属性 > 配置属性 > 调试 > 命令)

is pointing to the output file built by your selected configuration.

指向由您选择的配置构建的输出文件。

(Properties > Configuration Properties > General > Output Directory),

(属性 > 配置属性 > 常规 > 输出目录),

(Properties > Configuration Properties > Linker > General > Output File)

(属性 > 配置属性 > 链接器 > 常规 > 输出文件)

回答by yan bellavance

add a break point to the end of the program or wait for a keyboard hit

在程序末尾添加断点或等待键盘敲击

回答by Ben Mathews

The classic way to keep a console app from exiting is to add another input query so the program pauses until enter is hit.

阻止控制台应用程序退出的经典方法是添加另一个输入查询,以便程序暂停,直到按下 Enter。

回答by SirRupertIII

I just had this problem, maybe it'll help some one as frustrated as I was. I was just hitting f5, which debugs the program. I went to Debug -> Build Solution, or f7 and it built it and now I can press f5. Super tiny little thing. It normally works if I just press f5, but I'll hit f7 first now.

我刚刚遇到了这个问题,也许它会帮助像我一样沮丧的人。我只是按 f5,它会调试程序。我去调试 - > 构建解决方案,或 f7 并构建它,现在我可以按 f5。超级小的小东西。如果我只是按 f5,它通常可以工作,但我现在先按 f7。

回答by Prof. Hell

Go to the debug folder to see what .exefile build. after that rename your solution nameto your .exefile name to solve your problem.

转到调试文件夹以查看.exe构建的文件。之后,将您的重命名solution name为您的.exe文件名以解决您的问题。