<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Step by step guide for installing static binaries</title>
		<link>http://www.allegro.cc/forums/view/616753</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 22 Feb 2017 12:07:59 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Many of us seem to struggle with getting A5 to work. I have a new machine and have big difficulties in getting the right libraries working. Before I tell about my lousy attempts, I want to know if there are any guides about how to install A5 on Code:;Blocks and Mingw. The newest binaries of A5 and dependencies seem to have a bit differing file list from those explained on the Wiki here:<br /><a href="https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5">https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5</a></p><p>I have Code::Blocks 16.01, Mingw 6.2.0, 64 bit Windows. I&#39;ve downloaded allegro-mingw-gcc6.2.0-x64-static-5.2.2
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Sun, 19 Feb 2017 04:01:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There are no up-to-date guides for MinGW, as far as I know. I&#39;m guessing the issue most people run into is that they don&#39;t match the mingw distro/version with the ones in the binaries... there&#39;s like 3 types of MinGWs out there, and they keep changing gcc versions every few months as well. I&#39;m guessing the main issue, however, is matching the exception handling mechanism and the threads which are the common differences between MinGWs.</p><p>Embarrassingly, I don&#39;t know which ones the binaries use (it&#39;s whatever the default is for MSYS2).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 20 Feb 2017 02:42:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>As I wrote, I downloaded allegro-mingw-gcc6.2.0-x64-static-5.2.2. <br />And &quot;C:\gcc --version&quot; tells me that Mingw is 6.2.0.: </p><p><tt>
C:\Users\admin_johha&gt;gcc --version
gcc (x86_64-win32-sjlj-rev1, Built by MinGW-W64 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</tt></p><p><tt>
C:\Users\admin_johha&gt;g++ --version
g++ (x86_64-win32-sjlj-rev1, Built by MinGW-W64 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</tt></p><p>Could the &quot;sjlj-rev1&quot; thing be the problem? If so, where is that explained?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Mon, 20 Feb 2017 03:04:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So I looked it up, and the binaries were created with these parameters:</p><p>32 bit:</p><p>Version: 6.2.0<br />Exceptions: DWARF<br />Threads: Posix<br />Revision: 2</p><p>64 bit:</p><p>Version: 6.2.0<br />Exceptions: SEH<br />Threads: Posix<br />Revision: 2</p><p>Revision is probably unimportant. You, on the other hand have a compiler with these parameters:</p><p>64 bit:</p><p>Version: 6.2.0<br />Exceptions: SJLJ<br />Threads: Win32<br />Revision: 1</p><p>So almost a complete mismatch. I&#39;ll include that information in the binary names next time, as it is pretty important...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 20 Feb 2017 07:29:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="remote-thumbnail"><span class="json">{"name":"930-7c5a556c196d35c3fbb0dc8d0ed66f9b.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/5\/b515214a9ca423c131664503f2628513.png","w":299,"h":183,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/5\/b515214a9ca423c131664503f2628513"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/b/5/b515214a9ca423c131664503f2628513-240.jpg" alt="930-7c5a556c196d35c3fbb0dc8d0ed66f9b.jpg" width="240" height="146" /></span></p><p>Now I have a working setup for my Windows 64 with Mingw, c/c++, and Allegro 5.2.2</p><p>It was the posix and seh things that was the problem. Though I have a slight clue about what they are, I really missed their importance in choosing the right compiler.</p><p>So getting Allegro 5 work on 64 bit for Windows, Code::Blocks and Mingw included the following:</p><p>Get the latest Code::Blocks from here: <a href="http://www.codeblocks.org/downloads/26">http://www.codeblocks.org/downloads/26</a><br />You might want to pick one with Mingw, although it will be the wrong version. But the toolchains will probably be named correctly, even though you switch later to a correct Mingw. I installed Code::Blocks to C:\CodeBlocks\. </p><p>Get the right Mingw from this page: <a href="https://sourceforge.net/projects/mingw-w64/files/">https://sourceforge.net/projects/mingw-w64/files/</a><br />Scroll down to the sub-header MinGW-W64 GCC-6.2.0, since 6.2.0 is the version that the latest A5 binaries are built with. Pick the x86_64-<b>posix-seh</b> file and open the package with 7-Zip or a similar unzipper.<br />What I did was I dragged the folder mingw64 from the 7-Zip program window to C:\CodeBlocks\</p><p>At this point I checked that Code::Blocks worked with Mingw. In Settings-&gt;Compiler settings it should look like this:</p><p><span class="remote-thumbnail"><span class="json">{"name":"610796","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/3\/b392312e6daaf159462bb0eba9278221.png","w":794,"h":584,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/3\/b392312e6daaf159462bb0eba9278221"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/b/3/b392312e6daaf159462bb0eba9278221-240.jpg" alt="610796" width="240" height="176" /></span></p><p>All the program files should be found in C:\CodeBlocks\mingw64\bin, if you have to pick them at this point. If you installed Code::Blocks <i>with</i> Mingw, there might be an extra Mingw subdirectory in the path.</p><p>Next thing was to download the Allegro 5 stuff from here: <a href="http://download.gna.org/allegro/allegro-bin/5.2.2/">http://download.gna.org/allegro/allegro-bin/5.2.2/</a><br />Pick the file including x64-static in the name. Since it&#39;s a .zip, it opens nicely in Windows 7 explorer. Open the include folder and drag the allegro5 folder to C:\CodeBlocks\mingw64\include\ so that allegro5 becomes a sub folder. Open the lib folder and drag all *static.a files into C:\CodeBlocks\mingw64\lib</p><p>Next download the Allegro dependencies from here: <a href="http://download.gna.org/allegro/allegro-deps/1.5.0/">http://download.gna.org/allegro/allegro-deps/1.5.0/</a><br />Pick the file including x64 in the name. Open it like you opened the Allegro stuff. Drag all files inside the lib folder into C:\CodeBlocks\mingw64\lib. You don&#39;t need the include folder stuff, since all Allegro stuff is already compiled.</p><p>To get an Allegro5 project compiling in Code::Blocks, you now have to include all these libraries. Having your project open, go to Project-&gt;Project build options, pick Linker settings tab and add the following libraries from C:\CodeBlocks\mingw64\lib. <br />All *static.a files except the *debug-static.a files and the *monolith-static.a.<span class="ref"><sup>[<a href="#">1</a>]</sup></span><br />All the dependencies, which are:
</p><pre>
libdumb.a
libFLAC.a
libfreetype.a
libjpeg.a
libogg.a
libopus.a
libopusfile.a
libphysfs.a
libpng16.a
libtheoradec.a
libvorbis.a
libvorbisfile.a
libzlib.a
</pre><p>
Actually I haven&#39;t included all of these. I guess I have to include all the missing ones, if my code requires some of these.</p><p>Next set of libraries to be included in the project are in the C:\CodeBlocks\mingw64\x86_64-w64-mingw32\lib folder. There are 15 files. The list I got from <a href="https://www.allegro.cc/forums/thread/616704/1027993#target">this thread.</a> Check code line 34 and further:
</p><pre>
libgdiplus.a 
libuuid.a 
libkernel32.a 
libwinmm.a 
libpsapi.a 
libopengl32.a 
libglu32.a 
libuser32.a 
libcomdlg32.a 
libgdi32.a 
libshell32.a 
libole32.a 
libadvapi32.a 
libws2_32.a 
libshlwapi.a 
</pre><p>

Finally there are two library files yet to be included:<br />libstdc++.a<br />libgcc.a</p><p>These two I found in C:\CodeBlocks\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0<br />But instead of adding them to this list of link libraries, the standard way is to include them in the Other linker options (to the right) as:<br />-static-libstdc++<br />-static-libgcc</p><p>Since the order of the linked libraries is important, here&#39;s a screenshot of the order. Especially vorbisfile and vorbis have their peculiar place in the list. Don&#39;t know if it&#39;s important, but that&#39;s how it&#39;s shown in every previous guide.</p><p><span class="remote-thumbnail"><span class="json">{"name":"610797","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/3\/539abf02e668e5d66f25f18766929c1a.png","w":519,"h":649,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/3\/539abf02e668e5d66f25f18766929c1a"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/5/3/539abf02e668e5d66f25f18766929c1a-240.jpg" alt="610797" width="240" height="300" /></span></p><p>[to be continued...]<br />The search directories for the compiler and the linker have to be yet set. I have them probably correct, but I won&#39;t show them yet, because it might be a bit unorthodox solution. Also all the above might include some details that are not the right way to do it, although it works.
</p><div class="ref-block"><h2>References</h2><ol><li>All liballeg files can be replaced by the single monolith-static.a file, but I prefered having each one in the list. This will be my A5 template project file and this way I can pick away each library I don&#39;t use, to reduce the size of the final single executable file.</li></ol></div></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Mon, 20 Feb 2017 14:39:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Awesome, we should update the wiki once it&#39;s stable. I don&#39;t think the vorbis and ogg need to be in that exact spot, probably anywhere after the acodec addon should work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 22 Feb 2017 12:07:59 +0000</pubDate>
	</item>
</rss>
