<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>How does distribution of dlls work with allegro?</title>
		<link>http://www.allegro.cc/forums/view/618348</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 28 Jan 2021 00:30:29 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve finished my project, but I&#39;m not sure what the standard practices are for distributing your project with allegro and its underlying dlls.</p><p>Can anyone give me advice on what I should include in my github repo or my itch release?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AleaInfinitus)</author>
		<pubDate>Thu, 21 Jan 2021 02:11:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This advice applies to the official binaries you get from github.</p><p>If you&#39;re using MSYS2/MinGW, the easiest way to distribute things is to link against the monolith dll and then you only need to include the C/C++ runtime dlls which you can find in the MinGW directory. In total, you&#39;ll need:</p><pre class="terminal">allegro_monolith-5.2.dll
libgcc_s_seh-1.dll
libstdc++-6.dll
libwinpthread-1.dll</pre><p>

If you&#39;re using MSVC with Nuget packages, then it&#39;s pretty easy to link statically. If you also link in the C/C++ runtime statically, there won&#39;t be any dlls at all. I don&#39;t recall what the C/C++ runtime DLL for MSVC is called (and you probably can&#39;t redistribute it either, you&#39;re supposed to tell people to download the install from Microsoft).</p><p>In general, if you&#39;re not sure, you can use the Dependency Walker (<a href="https://www.dependencywalker.com/">https://www.dependencywalker.com/</a>) which will tell you which DLLs your program needs. Include all of those that don&#39;t appear to be included with Windows.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Thu, 21 Jan 2021 05:16:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you use msys or msys2, you can use objdump to find out which DLL dependencies you need.</p><p>For example, if you run:</p><p><span class="source-code">objdump <span class="k3">-</span>p <span class="k3">*</span>.exe <span class="k3">*</span>.dll <span class="k3">|</span> grep <span class="s">'DLL Name:'</span></span></p><p>This gives you a list of DLLs that your EXE is dependent on. Search your system for the DLLs (if your program runs, they must be somewhere on your system). Then  copy those DLLs into the current directory and run the same command again. The list gets longer: the new DLLs also have dependencies that you have to include as well. Keep running this until the list of DLLs no longer changes.</p><p>I write bash scripts for myself that contain this snippet:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">for</span> i in $<span class="k2">(</span>objdump <span class="k3">-</span>p <span class="k3">*</span>.exe <span class="k3">*</span>.dll <span class="k3">|</span> grep <span class="s">'DLL Name:'</span> <span class="k3">|</span> sort <span class="k3">|</span> uniq <span class="k3">|</span> sed <span class="s">"s/\s*DLL Name: //"</span><span class="k2">)</span>
<span class="k1">do</span>
  <span class="k1">if</span> <span class="k2">[</span> <span class="k3">-</span>e $i <span class="k2">]</span>
then
  echo <span class="s">"FOUND: $i"</span>
<span class="k1">else</span>
  echo <span class="s">"MISSING: $i"</span>
fi
done
</pre></div></div><p>

There are certain DLL dependencies that you can assume are standard on windows, they tend to be all caps filenames, and they are in C:\Windows</p><p>Finally, pay attention to whether you have 32-bit or 64-bit exe/dlls. On Msys you can check by running the <span class="source-code">file</span> command. That will report them as PE32 (32 bit) or PE32+ (64 bit)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (amarillion)</author>
		<pubDate>Thu, 21 Jan 2021 20:35:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you downloaded my binaries, there is a /bin/dlls folder. Just include the dlls in there, and the appropriate dll for allegro whether it&#39;s debugging or not. Or link statically and don&#39;t distribute any dlls. There&#39;s a list of libraries to static link in the base folder.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 28 Jan 2021 00:30:29 +0000</pubDate>
	</item>
</rss>
