<p>I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine.</p>

<p>Without doing this you get the error message that the application configuration is not correct and to reinstall.</p>

[{'answer_id': 3310, 'author': 'Josh', 'author_id': 257, 'author_profile': 'https://Stackoverflow.com/users/257', 'pm_score': 0, 'selected': False, 'text': "<p>You'd be looking to static link (as opposed to dynamically link)</p>\n\n<p>I'm not sure how many of the MS redistributables statically link in.</p>\n"}, {'answer_id': 4472, 'author': 'David Sykes', 'author_id': 259, 'author_profile': 'https://Stackoverflow.com/users/259', 'pm_score': 0, 'selected': False, 'text': '<p>If you are looking to find out which dll\'s your target machine is missing then use depends.exe which used to come with MSDev, but can also be found <a href="http://dependencywalker.com/" rel="nofollow noreferrer">here</a>. Testing this on a few target machines should tell you which dll\'s you need to package with your application.</p>\n'}, {'answer_id': 5321, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<p>You need to set the run-time library (Under C/C++ -> Code Generation) for ALL projects to static linkage, which correlates to the following default building configurations:</p>\n\n<ul>\n<li>Multithreaded Debug/Release</li>\n<li>Singlethreaded Debug/Release</li>\n</ul>\n\n<p>As opposed to the "DLL" versions of those libraries.</p>\n\n<p>Even if you do that, depending on the libraries you\'re using, you might have to install a Merge Module/framework/etc. It depends on whether static LIB versions of your dependencies are available.</p>\n'}, {'answer_id': 10141, 'author': 'Michael Pryor', 'author_id': 245, 'author_profile': 'https://Stackoverflow.com/users/245', 'pm_score': 5, 'selected': True, 'text': '<ol>\n<li>Choose Project -> Properties</li>\n<li>Select Configuration -> General</li>\n<li>In the box for how you should link MFC, choose to statically link it.</li>\n<li>Choose Linker -> Input.  Under <strong>Additional Dependencies</strong>, add any libraries you need your app to statically link in.</li>\n</ol>\n'}, {'answer_id': 51664, 'author': 'Simon Steele', 'author_id': 4591, 'author_profile': 'https://Stackoverflow.com/users/4591', 'pm_score': 2, 'selected': False, 'text': '<p>Be aware that <a href="http://blogs.msdn.com/martynl/archive/2005/10/13/480880.aspx" rel="nofollow noreferrer">Microsoft do not recommend that you static link the runtime into your project</a>, as this prevents it from being serviced by windows update to fix critical security bugs. There are also potential problems if you are passing memory between your main .exe and .dll files as if each of these static links the runtime you can end up with malloc/free mismatch problems.</p>\n\n<p>You can include the DLLs with the executable, without compiling them into the .exe and without running the redist tool - this is what I do and it seems to work fine. </p>\n\n<p>The only fly in the ointment is that you need to include the files twice if you\'re distributing for a wide range of Windows versions - newer OSs need the files in manifest-defined directories, and older ones want all the files in the program directory.</p>\n'}, {'answer_id': 60552705, 'author': 'RedBruhMoment', 'author_id': 12993910, 'author_profile': 'https://Stackoverflow.com/users/12993910', 'pm_score': 0, 'selected': False, 'text': '<p>You should use a static link and add all libraries you need under additional dependencies.</p>\n'}]
['https://Stackoverflow.com/questions/3230', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/370/']