Creating executables

Aug 3, 2011 at 9:15pm
I'm creating a program that I plan on distributing to a multitude of people. I am using Microsoft Visual C++ 2010 Express. How can I create an executable (.exe) from my project, one that I could send to another computer and have it able to be used?

Thanks



Sean
Last edited on Aug 3, 2011 at 9:15pm
Aug 3, 2011 at 9:17pm
When you compile your project, an executable is always generated (your program couldn't run otherwise).
Look somewhere in your project folder, it should be in a folder called "bin", "dist", "Release" or similar.
Aug 3, 2011 at 10:38pm
Gotcha. Thanks Arthar



Sean
Aug 3, 2011 at 10:48pm
Hey bud just btw whenever you compile a program using Visual C++ 2010 the computer running said executable NEEDS to have msvcr100.dll either installed on their computer or in the same directory as the .exe.

I've tried to find a way to statically link msvcr100.dll but no luck...has anyone else figured it out? Not much on google...
Aug 3, 2011 at 11:35pm
It seems an easy fix to that would be to just download msvcr100.dll into the folder with the executable so it's included nonetheless.

Thanks for the info man, I didn't know that.
Aug 3, 2011 at 11:37pm
No, that is for running debug builds. Just build in Release mode rather than Debug and it won't need that DLL.
Aug 3, 2011 at 11:40pm
Debug/release doesn't matter, you always need a runtime lib.

Either Supply the dll with your exe (which I don't recommend), or build the runtime lib into your exe statically.

To do the latter, right click on your Project in the solution explorer (side panel) and go to Properties. Expand the "C/C++" tree, and select the "Code Generation" page.

Look for the "Runtime Library" field on the right, change it to "MultiThreaded" for release builds, or "MultiThreaded Debug" for debug builds.

Apply and rebuild.
Aug 4, 2011 at 12:40am
Be aware that unless you are very careful and explicit about how the compiler creates your EXE file, it is likely that it depends on some DLLs, some of which your user may not have installed. Make sure you distribute your application with all the required DLLs.
http://www.cplusplus.com/forum/windows/12509/
http://www.cplusplus.com/forum/general/20909/

You may want to create an installer to distribute your program. Personally, I like Inno Setup.
http://www.jrsoftware.org/isinfo.php
http://www.cplusplus.com/forum/beginner/31106/

Hope this helps.
Topic archived. No new replies allowed.