Yuri A. Brito
Yuri A. Brito

Reputation: 231

Program runs after building but not when executed from Release/program.exe

So I've configured a solution on VS 2013. I'm linking OpenGL, GLEW and GLFW3. When I hit ctrl+f5 to build/run the release version it goes without errors, the program runs correctly after building.

However, after that when I try to manually execute the program using the .exe file created inside the Release folder it crashes.

Anyone has any clue on what can be the problem?

Upvotes: 0

Views: 160

Answers (3)

Andon M. Coleman
Andon M. Coleman

Reputation: 43359

MSVC's built-in debugger is configured to use a different working directory when you start your software than the actual location of the .exe file.

Often it is configured to use the project's base directory. If your DLLs and other resources that are loaded relative to the working directory at run-time are installed in that directory, then this is why it runs fine from the debugger but not when you launch it with a working directory of: "Release".

Often as a final step in the build process well-designed projects are configured to move/copy the .exe to a much more reasonable location than "Release" for deployment.

Upvotes: 1

Anastacio Gianareas
Anastacio Gianareas

Reputation: 151

Place your DLLs + media inside the release folder (under bin)

Upvotes: 2

Barış Uşaklı
Barış Uşaklı

Reputation: 13532

Does the exe have all the files it needs in the Release folder? The working directory that is used when you run from VS and the one when you double click the exe are probably different.

Upvotes: 1

Related Questions