<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Installing 4.9.3 on Windows using MinGW</title>
		<link>http://www.allegro.cc/forums/view/596202</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 03 May 2008 11:37:43 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I had a lot of trouble getting 4.9.3 to compile, so I thought I would post this to let everyone else who wants to try it know how I got things to work.</p><p>First, I had to download the technology preview version of MinGW to get gcc 4, because I still haven&#39;t been able to successfully build all of the shared library under windows.  Here are the files I got, but you may not need them all:</p><pre>
gcc-core-4.2.1-sjlj-2.tar.gz
gcc-g++-4.2.1-sjlj-2.tar.gz
libgcc_sjlj_1.dll.gz
binutils-2.18.50-20080109-2.tar.gz
mingw32-make-3.81-20080326-2.tar.gz
gdb-6.8-mingw-3.tar.bz2
w32api-3.11.tar.gz
mingw-runtime-3.14.tar.gz
mingw-utils-0.3.tar.gz
</pre><p>

If you download the MinGW 5.1.4 installer that will only install gcc 3.4.5, so you will need to manually download these and extract them into a MinGW directory.  Don&#39;t forget to change your MINGDIR variable and the path to MinGW/bin.  You then have to go into the MinGW/bin directory and remove the -sjlj from all of the exe files.</p><p>Next you&#39;ll need CMake.  You can get version 2.4 from <br /><a href="http://www.cmake.org/HTML/index.html">here</a>.</p><p>You&#39;ll also need the DirectX 9 header files and libraries, which can be found<br /><a href="http://trent.gamblin.ca/dx/dx9mgw.zip">here.</a></p><p>Extract the allegro-4.9.3 sources to a directory and open up a command prompt window.  Make sure gcc works by typing gcc -v.  You should see this:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
D:\PROGRA~1\allegro5\allegro&gt;gcc -v<br />Using built-in specs.<br />Target: mingw32<br />Configured with: ../gcc-4.2.1-2-src/configure --with-gcc --enable-libgomp --host<br />=mingw32 --build=mingw32 --target=mingw32 --program-suffix=-sjlj --with-arch=i48<br />6 --with-tune=generic --disable-werror --prefix=/mingw --with-local-prefix=/ming<br />w --enable-threads --disable-nls --enable-languages=c,c++,fortran,objc,obj-c++,a<br />da --disable-win32-registry --enable-sjlj-exceptions --enable-libstdcxx-debug --<br />enable-cxx-flags=-fno-function-sections -fno-data-sections --enable-version-spec<br />ific-runtime-libs --disable-bootstrap<br />Thread model: win32<br />gcc version 4.2.1-sjlj (mingw32-2)
</p></div></div><p>

It&#39;s a good idea to make a build directory.  Go to your allegro directory, and type this:</p><pre>
md build
cd build
cmake .. -G &quot;MinGW Makefiles&quot; -DSHARED=off
</pre><p>

once cmake finishes, type mingw32-make and wait...</p><p>If everything went right, when it&#39;s done compiling just type mingw32-make install</p><p>Now you&#39;ve got a working Allegro 4.9.3 installation.  To use it, you need to <br /><span class="source-code"><span class="p">#include &lt;allegro5/allegro.h&gt;</span></span></p><p>and link with these libraries:</p><p><tt>-lalleg_s-4.9.3 -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound -ld3d9 -lopengl32</tt></p><p>Hopefully that all works.  If you used the build directory, you&#39;ll have to run the examples from inside the directory where the .c files are, or they won&#39;t find the datafiles and other things they need to run.  For example:</p><pre>
cd \allegro5\allegro\examples
..\build\examples\exnewapi.exe
</pre><p>

Alternatively, you can simply copy all of the datafiles and other things into your build/examples directory</p><p>Hope this helps.</p><p>WG
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (wiseguy)</author>
		<pubDate>Wed, 30 Apr 2008 23:13:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
You then have to go into the MinGW/bin directory and remove the -sjlj from all of the exe files.
</p></div></div><p>

No need to rename them all, just gcc.exe and g++.exe. In fact, in my experience renaming them all results in broken MinGW installation.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Wed, 30 Apr 2008 23:47:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>hmmm maybe that&#39;s what is causing me problems...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (wiseguy)</author>
		<pubDate>Wed, 30 Apr 2008 23:58:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t mean to sound rude, and I know 4.9.3 is in beta, but it seems quite ridiculous that in order to compile allegro you have to dump your stable version of gcc and use an unstable &#39;future&#39; version. Surely there&#39;s no code in allegro that your average c compiler can&#39;t compile?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 01 May 2008 01:00:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well I&#39;m sure it works with gcc 3 (gcc4 is a few years old now and is much more strict and standards compliant). As far as I know, the main problem with mingw based on gcc3 is its relatively poor ability to handle dll&#39;s.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Goalie Ca)</author>
		<pubDate>Thu, 01 May 2008 06:42:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My earlier post was a bit of an overkill, as a couple couple of the guys really helped me out with getting things working.  The only thing I can say is to give it a try with the stable releases, but just keep in mind with those you can only build the shared library... </p><p>I just got the sound stuff working today and the whole thing is pretty darn cool.  I&#39;m really looking forward to a non WIP version</p><p>Thanks to everyone who helped me get it to compile for me.</p><p>WG
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (wiseguy)</author>
		<pubDate>Thu, 01 May 2008 07:53:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well done!  <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />  I&#39;ve spent much time also getting the most recent mingw system set up, i know how much of an ordeal it is.  Thanks for taking the time to explain it and documenting it here.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (aj5555)</author>
		<pubDate>Thu, 01 May 2008 12:37:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Surely there&#39;s no code in allegro that your average c compiler can&#39;t compile?
</p></div></div><p>

Readme says: <b>Note:</b> For MinGW with gcc &lt; 4, you cannot build a static library because TLS (thread local storage, using __thread) support was not introduced until version 4.<br />So gcc3 doesn&#39;t have the required feature.</p><p>And gcc4 is not a &quot;future&quot; release.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Fri, 02 May 2008 00:28:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p> About building allegro5</p><p>Now I got this error:</p><p>allegro/src/win/d3d_disp.c error: &#39;D3D9b_SDK_VERSION&#39; undeclared
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (UCL057)</author>
		<pubDate>Fri, 02 May 2008 10:30:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Your d3d9.h is wrong.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Fri, 02 May 2008 12:36:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>using the latest DirectX SDK is not likely to work.  there have been several posts around this forum about which directX SDK to use.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (aj5555)</author>
		<pubDate>Fri, 02 May 2008 14:07:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Read the first post in this thread again to see the link to the correct DX9 headers.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 02 May 2008 14:19:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p> I have the right DX9<br /> but there are errors in building allegro<br /> One of the errors was something with the header<br />dsound.h error: redefinition of struct D3DVECTOR<br />The latest version of gcc 4 wont work (gcc --broken)<br />but the gcc in my Dev-Cpp/bin works except<br />of all these errors.....
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (UCL057)</author>
		<pubDate>Sat, 03 May 2008 10:53:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>dsound.h?</p><p>That must be from the old audio. You can safely disable that in the cmake all the sound options like digi off. The new audio engine (still a wip) is an addon and appears as &quot;WANT_AUDIO&quot; in the configure and it require OpenAL to be installed (no directsound backend yet).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Goalie Ca)</author>
		<pubDate>Sat, 03 May 2008 11:11:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p> About dsound.h <br />Tell me how to disable the<br />sound options </p><p> Is it CmakeCachelist or???</p><p>I have found some undeclared functions in allegro5,<br />strange...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (UCL057)</author>
		<pubDate>Sat, 03 May 2008 11:37:43 +0000</pubDate>
	</item>
</rss>
