出现这种情况的原因通常是因为生成exe文件的目录和执行目录不一致导致的,排查方法如下:
1、output directory
菜单project—properties—configuration properties—general—output directory,这个就是debug生成exe的目录;
2、command和working directory
configuration properties—debugging—command,调用exe的命令,一般是宏$(TargetPath)来决定,也就是第一步中output directory的完整目录+exe文件名;
configuration properties—debugging—working directory,exe执行目录,要与output directory保持一致;
3、output file
第1和第2步中的几个配置项调整好之后基本基本可以解决此类问题,不过还有可能仍然报找不到exe的错误,此时需要看下project—properties—linker—general—output file的配置是否与第二步的command一致;
##4、忽略告警
以上三步调整完毕后,如果debug时仍然弹出无法找到exe的窗口,只需勾选忽略即可
读后有收获可以支付宝请作者喝咖啡: