<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Build error and patch(s) for Allegro 4.4.X from git</title>
		<link>http://www.allegro.cc/forums/view/614953</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 15 Jan 2015 08:30:09 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>wsystem.c fails to build with an error about conflicting types for the DllMain function. wsystem.c defines one, and so does winbase.h. I don&#39;t know which is correct so I don&#39;t know how to patch this. Anyone know?</p><pre>
c:\mingw\LIBS\Alleg44X_git\allegro\build&gt;mingw32-make install
[  1%] Building C object CMakeFiles/allegro.dir/src/win/wsystem.c.obj
C:\mingw\LIBS\Alleg44X_git\allegro\src\win\wsystem.c:35:15: error: conflicting types for &#39;DllMain&#39;
 BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason, LPVOID lpReserved)
               ^
In file included from C:/mingw/include/windows.h:62:0,
                 from C:/mingw/LIBS/Alleg44X_git/allegro/include/winalleg.h:54,
                 from C:/mingw/LIBS/Alleg44X_git/allegro/include/allegro/platform/aintwin.h:31,
                 from C:\mingw\LIBS\Alleg44X_git\allegro\src\win\wsystem.c:27:
C:/mingw/include/winbase.h:1051:13: note: previous declaration of &#39;DllMain&#39; was here
 BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID);
             ^
CMakeFiles\allegro.dir\build.make:3072: recipe for target &#39;CMakeFiles/allegro.dir/src/win/wsystem.c.obj&#39; failed
mingw32-make[2]: *** [CMakeFiles/allegro.dir/src/win/wsystem.c.obj] Error 1
CMakeFiles\Makefile2:62: recipe for target &#39;CMakeFiles/allegro.dir/all&#39; failed
mingw32-make[1]: *** [CMakeFiles/allegro.dir/all] Error 2
Makefile:105: recipe for target &#39;all&#39; failed
mingw32-make: *** [all] Error 2

c:\mingw\LIBS\Alleg44X_git\allegro\build&gt;
</pre><p>

Also, here is a patch to enable building of the addons as shared libraries :
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="k3">-</span><span class="k3">-</span><span class="k3">-</span> CMakeLists.old.txt  <span class="n">2015</span><span class="k3">-</span><span class="n">01</span><span class="k3">-</span><span class="n">03</span> <span class="n">16</span><span class="k2">:</span><span class="n">35</span><span class="k2">:</span><span class="n">21</span>.<span class="n">895331800</span> <span class="k3">-</span><span class="n">0600</span>
<span class="number">  2</span><span class="k3">+</span><span class="k3">+</span><span class="k3">+</span> CMakeLists.txt      <span class="n">2015</span><span class="k3">-</span><span class="n">01</span><span class="k3">-</span><span class="n">03</span> <span class="n">16</span><span class="k2">:</span><span class="n">35</span><span class="k2">:</span><span class="n">51</span>.<span class="n">803573800</span> <span class="k3">-</span><span class="n">0600</span>
<span class="number">  3</span>@@ <span class="k3">-</span><span class="n">918</span>,<span class="n">12</span> <span class="k3">+</span><span class="n">918</span>,<span class="n">17</span> @@
<span class="number">  4</span> option<span class="k2">(</span>WANT_LOGG <span class="s">"Enable logg"</span> on<span class="k2">)</span>
<span class="number">  5</span> option<span class="k2">(</span>WANT_JPGALLEG <span class="s">"Enable JPGAlleg"</span> on<span class="k2">)</span>
<span class="number">  6</span>
<span class="number">  7</span><span class="k3">-</span><span class="k1">if</span><span class="k2">(</span>WANT_FRAMEWORKS<span class="k2">)</span>
<span class="number">  8</span><span class="k3">+</span><span class="k1">if</span> <span class="k2">(</span>BUILD_SHARED_LIBS<span class="k2">)</span>
<span class="number">  9</span>     set<span class="k2">(</span>ADDON_LINKAGE SHARED<span class="k2">)</span>
<span class="number"> 10</span> <span class="k1">else</span><span class="k2">(</span><span class="k2">)</span>
<span class="number"> 11</span>     set<span class="k2">(</span>ADDON_LINKAGE STATIC<span class="k2">)</span>
<span class="number"> 12</span> endif<span class="k2">(</span><span class="k2">)</span>
<span class="number"> 13</span>
<span class="number"> 14</span><span class="k3">+</span><span class="k1">if</span><span class="k2">(</span>WANT_FRAMEWORKS<span class="k2">)</span>
<span class="number"> 15</span><span class="k3">+</span>    set<span class="k2">(</span>ADDON_LINKAGE SHARED<span class="k2">)</span>
<span class="number"> 16</span><span class="k3">+</span>endif<span class="k2">(</span><span class="k2">)</span>
<span class="number"> 17</span><span class="k3">+</span>
<span class="number"> 18</span><span class="k3">+</span>
<span class="number"> 19</span> <span class="k1">if</span><span class="k2">(</span>WANT_ALLEGROGL<span class="k2">)</span>
<span class="number"> 20</span>     add_subdirectory<span class="k2">(</span>addons<span class="k3">/</span>allegrogl<span class="k2">)</span>
<span class="number"> 21</span> endif<span class="k2">(</span><span class="k2">)</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 04 Jan 2015 04:51:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The comment about DLL main says that it&#39;s necessary for DMC. I and most people couldn&#39;t care less what builds on DMC, so could you just test if removing it fixes the issue for you? Make sure it all still links and runs etc. Specifically, try the attached patch.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Fri, 09 Jan 2015 09:11:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Removing it is a good test, but if its dead simple to keep the compatibility, say an <span class="source-code">ifdef DMC</span> or just make the decl the same as windows&#39;s then it would be best to do that. imo.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 09 Jan 2015 09:13:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, I added the patch that does that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Fri, 09 Jan 2015 09:15:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Everything builds with the patch, static or dynamic, but I&#39;m getting a bunch of weird errors - &quot;Warning: corrupt .drectve at end of def file&quot;. It appears 4 times in a row for each executable linked. A static release build did that anyway, maybe others too.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 10 Jan 2015 02:16:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s a bit worrying, but I think it might be an issue with your MinGW setup (judging by my quick searches on the internets). I&#39;ll look into on my MinGW and see if I get this. Never thought I&#39;d be compiling Allegro 4 on Windows in 2015 <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sat, 10 Jan 2015 12:11:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m sure it&#39;s probably something I did or have left over somewhere that is doing it. It&#39;s troubling there is no uninstall target, or is there? I can&#39;t remember. Because I don&#39;t want an already pre-installed version of allegro to interfere with the compilation of the newer version (already hit that one once).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 10 Jan 2015 19:39:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>::sigh:: I can&#39;t seem to manage to build it. For whatever reason <span class="source-code">dat.exe</span> is not linking (the linking order is wrong).</p><p>Actually... the reason it&#39;s not building is because of the shared addons... can you verify that it actually builds with SHARED=on with a clean build directory?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 14 Jan 2015 10:47:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Latest git with a clean build compiles and links fine. No probs with dat.exe or anything else. All shared addon libraries built successfully. MinGW 4.8.1, Vista
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 15 Jan 2015 08:30:09 +0000</pubDate>
	</item>
</rss>
