<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Can&#39;t initialize allegro</title>
		<link>http://www.allegro.cc/forums/view/617114</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 30 Oct 2017 11:22:54 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello, I&#39;ve been trying to compile and run using msys2. I followed instructions in the wiki (with additional stuff in forums for cmake part) and I finally installed allegro(I think). But the problem is after compiling. I&#39;ve used:</p><p>gcc -Wall main.c `pkg-config --cflags --libs allegro-5 allegro_main-5`</p><p>and </p><p>gcc -c main.c<br />gcc main.o -lallegro -o a</p><p>but after I run the program, it gives allegro failed to initialize error(basically al_init() returns false)</p><p>I really don&#39;t know what to do :/
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (yasyaserov)</author>
		<pubDate>Sat, 28 Oct 2017 22:54:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can you add this code to your main function (before <span class="source-code"><a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a></span>) and see what it prints?</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">uint32_t</span> version <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_allegro_version"><span class="a">al_get_allegro_version</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="k1">int</span> major <span class="k3">=</span> version <span class="k3">&gt;</span><span class="k3">&gt;</span> <span class="n">24</span><span class="k2">;</span>
<span class="k1">int</span> minor <span class="k3">=</span> <span class="k2">(</span>version <span class="k3">&gt;</span><span class="k3">&gt;</span> <span class="n">16</span><span class="k2">)</span> <span class="k3">&amp;</span> <span class="n">255</span><span class="k2">;</span>
<span class="k1">int</span> revision <span class="k3">=</span> <span class="k2">(</span>version <span class="k3">&gt;</span><span class="k3">&gt;</span> <span class="n">8</span><span class="k2">)</span> <span class="k3">&amp;</span> <span class="n">255</span><span class="k2">;</span>
<span class="k1">int</span> release <span class="k3">=</span> version <span class="k3">&amp;</span> <span class="n">255</span><span class="k2">;</span>

<a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Library version: %d.%d.%d.%d\n"</span>, major, minor, revision, release<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Header version: %s\n"</span>, <a href="http://www.allegro.cc/manual/ALLEGRO_VERSION_STR"><span class="a">ALLEGRO_VERSION_STR</span></a><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

It it prints different things, then something went wrong when you installed Allegro (via <span class="source-code">make install</span>). Can you tell us what commands you used for <span class="source-code">cmake</span> and <span class="source-code">make</span>?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 29 Oct 2017 11:53:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>l guess that you have another, older version of allegro somewhere on your system that gets linked in at run time. On linux, you could try ldd program to see what kibraries will be linked at runtime.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Sun, 29 Oct 2017 12:08:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Library Version: 5.2.2.1<br />Header Version: 5.2.4 (GIT)</p><p>Yeah these are different.</p><p>I probably need to uninstall MSYS2 and reinstall everything.</p><p>What am I supposed to after installing mingw toolchain and dependencies.</p><p>I did:</p><p>git clone <a href="https://github.com/liballeg/allegro5.git">https://github.com/liballeg/allegro5.git</a></p><p>git checkout 5.0</p><p>mkdir build_allegro_monolith<br />cd build_allegro_monolith<br />cmake \<br />	-G&quot;MSYS Makefiles&quot; \<br />	-DCMAKE_SYSTEM_PREFIX_PATH=/mingw64/x86_64-w64-mingw32/ \<br />	-DWANT_MONOLITH=on \<br />	-DSHARED=off \<br />	../allegro5</p><p>make<br />make install</p><p>but I am guessing this is wrong, eh?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (yasyaserov)</author>
		<pubDate>Sun, 29 Oct 2017 13:58:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You want to &#39;git checkout 5.2&#39; or master if you&#39;re going to build allegro yourself. Don&#39;t mix binaries and custom installs.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 29 Oct 2017 23:16:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Somehow you have a separate installation of Allegro. Find where it is, and remove it. You can use the <a href="http://www.dependencywalker.com/">http://www.dependencywalker.com/</a> to see which DLLs your binary is loading (very useful if you plan to distribute your binary to other computers, so you include everything).</p><p>Also... yes, you want to do <span class="source-code">git checkout master</span>, or, perhaps, <span class="source-code">git checkout <span class="n">5</span>.<span class="n">2</span>.<span class="n">3</span>.<span class="n">0</span></span> if you want the most recent release.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 30 Oct 2017 11:22:54 +0000</pubDate>
	</item>
</rss>
