Visual Studio - Can't run program: the .exe can't be found - c++

I am working on a program and so far, it was working perfectly well but now I have a problem: when I build my project, it works, it generates the .exe but I can't run it, I get this error:
Unable to start program 'H:\C++\Shooter\Debug\Shooter.exe'. Specified file could not be found
(it's a translation)
When I look in the Debug folder, the exe is here and when I try to execute it manually, it throws the same error and deletes the .exe. Note that everything works on my second computer which has the same version of Visual Studio.
Also, this project shares the same solution than an other one (the server) but the server works fine.
I already tried repairing Visual Studio but it didn't solve my problem.
Thanks.

It was my antivirus that was causing the problem so I put the directory to my anti-virus safe zone.

Related

Code Execution cannot proceed because SDL2.dll was not found

I'm using Microsoft Visual Studio 2019 with c++ code. I'm working on a new project and Visual Studio has no issues building the code, however when I actually run the program I get this error.
I have SDL2 installed as I have another program that runs just fine. So I'm not really sure what the issue is here.
you can copy the SDL2.dll to the systemm32 folder and that should solve your problem

Unhandled exception at 0x74E733AB (ucrtbase.dll) in OpenClaw.exe

I wanted to tinker this open source remake of the famous Claw.
Visit https://github.com/pjasicek/OpenClaw
Before I start with how I've cloned this game and tried to build it, I'm new to the open source community. I did the following things.
I cloned the repository.
Opened the project using Visual Studio 2017 Community edition and I changed the Configuration to Release and platform to Win32.
I then built the libwap solution without any errors.
Then I used CMake 3.11.0 to generate the required files for the Box2D solution and then generated it and then the Box2D build was a success.
I built the Midiproc manually and finally, I tried building the entire solution.
It threw a MSVCR120D.dll missing error and I copied all the .dlls from the game's release folder https://github.com/pjasicek/OpenClaw/releases
Now the game runs just fine when I launch it from the File explorer, but when I try to launch it from Visual Studio 2017, it throws the following error.
Check out this image:
How do I run the game from Visual Studio? Have I misconfigured the Visual Studio?
If you need any more details on what I did, please let me know.
[EDIT] I want to configure Visual Studio to be able to run the release and modify the source code so I can tinker it and try to understand how the game works internally.
I cloned the repository again and did a clean compilation of all the solutions. Turns out there was a problem when I copied/overwritten all dlls from the release build. Now, the game builds and executes fine.
Thanks for the help.

OpenCV 2.4.8 Visual Studio 2012

I installed OpenCV 2.4.8 on Visual Studion 2012 (I am a student in CS, so VS is from dreamspark)
I did everything in the installation steps. Then I wrote a simple program to read an image and display it on the screen. When I first compile it, it gives me the error: "The program can't start because opencv_core248d.dll is missing from your computer. Try reinstalling the program to fix this problem.". BUT !!! When I go to the project folder, and run the .sln file, and THEN compile, IT WORKS! There are no missing dlls, the PATH is created, I saved the property sheets so I don't have to repeat the steps each time. So, why doesn't it compile within the IDE, and yet it does run fine in the second window IDE.
How do I solve this problem.
I SOLVED IT !!! Finally! After you write the directory in your PATH, you have to restart the computer, otherwise VS doesn't know where the dlls are. That's why it works when you open the project manually, and not within the IDE

Visual Studio 2012 does not generate exe

I've a C++ project in Visual Studio 2012 Express, and I started having problems lately. When I compile the project it works, nothing wrong, however when I try to execute it the .exe disappears. I mean, I compile the project, the project generates the exe file with no problems, but if I try to execute it from Visual Studio or directly from the output directory, Windows say to me:
Cannot start the program 'C:\Users\Adrian\Dropbox\MyApp\Debug\MyApp.exe'.
The system can not find the file specified
If I create another project, Hello World for example, there is no problem and the exe generates and executes good. So I guess the problem is specific to my project. I tried disabling Avast (because maybe he delete the file) and the problem persists.
Also I create another project, including the files and... the problem is still here...
I check the project options, specifically general and debug options and I see nothing wrong.
So does anyone have an idea what may be wrong?
The output directory is $(SolutionDir)$(Configuration)\ and I'm compiling in Debug mode.
The windows error message is misleading. It should state that, loading a library (dll) failed. You might run the program with a process monitor (see: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx)

MSVCR100D.dll error at runtime

Ok , so i created a program using VC++ 2010. it ran just fine.
Got to work and could only install vc++ 8 due to having a crappy computer that is still stuck on xp sp2...
Everything will link up and build with no errors, But when the program starts to run i get "This application has failed to start because MSVCR100D.dll was not found"
I tried changing the runtime libary from MDd to MTd but still no luck...any idea?
That DLL comes with Visual Studio 2010. If you want to use your program, you'll somehow have to get your hands on it. If possible at your work, you can download it. Another (probably better) option would be to take it with you from home on a USB drive.
Edit: You can also try re-creating the project, and then copying the source code over into the new project. Your newly created project (in Visual Studio 2008) should not be depending on that erroneous DLL.
Edit 2: As Hans Passant added in a comment, this DLL is needed by Debug compilations of your program. So if you simply compile as Release, you can safely ignore the first part of my post. (I hope I'm not breaking gentleman rules by adding this to my post.)
MSVCR100D.dll is for debug mode, and is installed with visual studio 2010, since 2008 has MSVCR80D. You can just google that and download it, and put it in the same direcrory, or just complie in release mode.
here is a download link. You need the small download zip file button, not the big ones.
http://www.dll-files.com/dllindex/dll-files.shtml?msvcr100d
As I know, MSVCR100D is debug version of runtime library used by VC2010。So, if your point either is:
(1) you do not have that dll which you really need, you can download at http://www.dll-files.com/dllindex/dll-files.shtml?msvcr100d or
(2) you want to run that program without requirement of MSVCR100/D.dll, you may need to recreate a project in VC8, then substitute with your source files (not solution file or other files managed by Vistual Studio).
FYI: If my memory were not going wrong, I remember that a project created by higher version of VS cannot be opened directly by lower version one. So, how did you build them?