Question

When I try to debug my program, I'm getting this error:

Unable to start program 'c:\stuff\TestStuff\Debug\TestStuff.exe'.
The system cannot find the file specified. 

I have the correct project set as the active project, and it is an .exe that has ran fine until now. If I only compile, it does in fact create TestStuff.exe in the proper directory, but if I try to debug it will delete TestStuff.exe and claim it doesn't exist! If I delete everything in the Debug directory without changing the source, it claims everything is up to date and doesn't need to compile. If I fiddle with my source files and recompile, the .exe appears but of course VC++ deletes it when I try to debug.

How can I escape this?

I tried renaming the .suo file to no avail, and there doesn't appear to be any other file to fiddle with besides the .sln itself... Restarting VC++ also doesn't help :(

edit: The Release build runs from the IDE but not the Debug build. That's like the exact opposite of useful

edit 2: if I manually run the debug TestStuff.exe I get this error:

Windows cannot find 'C:\stuff\TestStuff\Debug\TestStuff.exe'. Make sure you typed the name correctly, and then try again.

So I guess something is terribly wrong with my program now, not sure what or why it can compile but not run. Also, it deletes itself :(

Was it helpful?

Solution

It was caused by moving #include <CImg.h> from a header file to a .cpp file "closer" to where the CImg calls were done. I have no idea why, though.

OTHER TIPS

I have the same problem today. To fix it, I stop my anti-virus (Avast): it seems thats it considers my program as a suspicious exe.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top