<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Can&#39;t start Allegro application after build</title>
		<link>http://www.allegro.cc/forums/view/616058</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 28 Feb 2016 17:06:53 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi Everyone!</p><p>I followed the instructions at the official wiki to get started with allegro.cc (<a href="https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5">Windows, Code::Blocks and Allegro 5</a>). I chose the dynamic linking, because I usually prefer dynamic linking.<br />I think I did everything right, and the compiler built the project successfully. However, when I run my application, I get an error (see attached picture). The application is a simple program for testing initialization:
</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="p">#include &lt;iostream&gt;</span>
<span class="number">  2</span><span class="p">#include "allegro5/allegro.h"</span>
<span class="number">  3</span>
<span class="number">  4</span><span class="k1">int</span> main<span class="k2">(</span><span class="k1">int</span> argc, <span class="k1">char</span><span class="k3">*</span> argv<span class="k2">[</span><span class="k2">]</span><span class="k2">)</span>
<span class="number">  5</span><span class="k2">{</span>
<span class="number">  6</span>    <span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
<span class="number">  7</span>    <span class="k2">{</span>
<span class="number">  8</span>        std::cout <span class="k3">&lt;</span><span class="k3">&lt;</span> <span class="s">"Error initializing allegro!\n"</span><span class="k2">;</span>
<span class="number">  9</span>    <span class="k2">}</span>
<span class="number"> 10</span>    <span class="k1">else</span>
<span class="number"> 11</span>    <span class="k2">{</span>
<span class="number"> 12</span>        std::cout <span class="k3">&lt;</span><span class="k3">&lt;</span> <span class="s">"Allegro initialized successfully!\n"</span><span class="k2">;</span>
<span class="number"> 13</span>    <span class="k2">}</span>
<span class="number"> 14</span>
<span class="number"> 15</span>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 16</span><span class="k2">}</span>
</div></div><p>

I tried <a href="http://stackoverflow.com/questions/18668003/the-procedure-entry-point-gxx-personality-v0-could-not-be-located-in-the-dnyam">this</a> also, but nothing.</p><p>I do not know what I did wrong, but I will try to link statically, and update the post.</p><p><img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p>Thank you for any advance,<br />Lasoloz.</p><p>Update - here I my specs:<br />Windows 10 64bit<br />Code::Blocks 13.12 with MinGW 4.7.1<br />allegro-5.0.10-mingw-4.7.0</p><p>I also downloaded MinGW version 4.8.1, and I made a new compiler profile with new toolchain executables. After this I created a new Project with the new compiler and the new libraries: same error. After copying the libstdc++-6.dll (<a href="http://stackoverflow.com/questions/18668003/the-procedure-entry-point-gxx-personality-v0-could-not-be-located-in-the-dnyam">this question</a>) I get segmentation fault.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Sat, 20 Feb 2016 00:22:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sounds like you&#39;re compiling with a different version than you&#39;re linking with.</p><p>Though, a StackOverflow post says:</p><p><a href="http://stackoverflow.com/questions/7262362/mingw-the-procedure-entry-point-libiconv-could-not-be-located">http://stackoverflow.com/questions/7262362/mingw-the-procedure-entry-point-libiconv-could-not-be-located</a></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Make sure you have C:\MinGW\bin in your path before any other directory that contains libiconv-2.dll. Apparently the as.exe in some MinGW distributions are dependent on that DLL, and having an older version of it in the path somewhere (for example GnuWin32 tools) will cause as.exe to pick up the older version that doesn&#39;t have the entry point it&#39;s looking for.
</p></div></div><p>

So it could be load-order related. So in PATH, make sure MinGW is first AND restart your computer to ensure the changes apply globally.</p><p>ALSO, if you have multiple copies of that DLL and the wrong one gets found first, that&#39;s what gets loaded. That happened to a different MinGW user.</p><p>[edit]</p><p><a href="http://stackoverflow.com/questions/26564515/mingw-the-procedure-entry-point-libintl-setlocale-could-not-be-located">This post</a> had a clever idea. I didn&#39;t realize Windows has a where command.</p><p>Open up command and type 
</p><div class="source-code snippet"><div class="inner"><pre>where allegro-5.0.10-md.dll
</pre></div></div><p>

where, by default, only searches the PATH locations.</p><p>If it lists multiple (or NONE) you&#39;ve either got multiple versions, or it may not be in the path.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Sat, 20 Feb 2016 00:58:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t know. I have the default MinGW compiler what I have downloaded with Code::Blocks and I also have a compiler on the &quot;C&quot; drive. This is the first time I get this error (I have built a lot of SDL projects) and I have the Code::Block&#39;s compiler chosen in properties.<br />Also, I set up a statically linked version of the program, but I can&#39;t compile. When I use the &quot;-static-libstdc++&quot; command it says unrecognized command, when I don&#39;t use it wants the &quot;__gxx_personality_v0&quot;.<br />So, if I have problems with compiler setup, what should I do?</p><p>(There are some pictures about my configuration for reference)<br /><span class="remote-thumbnail"><span class="json">{"name":"610190","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/7\/b77b01feba2603f384b4d010a9adfd49.png","w":757,"h":575,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/7\/b77b01feba2603f384b4d010a9adfd49"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/b/7/b77b01feba2603f384b4d010a9adfd49-240.jpg" alt="610190" width="240" height="182" /></span><br /><span class="remote-thumbnail"><span class="json">{"name":"610191","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/2\/0230c3312a296423081e16d12ac2ac06.png","w":1041,"h":727,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/2\/0230c3312a296423081e16d12ac2ac06"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/0/2/0230c3312a296423081e16d12ac2ac06-240.jpg" alt="610191" width="240" height="167" /></span></p><p>EDIT:<br />I deleted the second MinGW compiler, still nothing.</p><p>EDIT2:<br />I looked up for the dlls with where. Nothing, they are not present in any path variables, however I have old, dumped projects containing it.<br />The truth is, I don&#39;t really know the use of these path variables. <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Sat, 20 Feb 2016 01:09:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="https://www.allegro.cc/forums/thread/616058/1020089#target">Laszlo Heim</a> said:</div><div class="quote"><p>
I think I did everything right, and the compiler built the project successfully. However, when I run my application, I get an error (see attached picture).</p><p><span class="remote-thumbnail"><span class="json">{"name":"610189","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/8\/e8d5c1bc23fbb44c6163b8bb9fd8643c.png","w":487,"h":183,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/8\/e8d5c1bc23fbb44c6163b8bb9fd8643c"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/e/8/e8d5c1bc23fbb44c6163b8bb9fd8643c-240.jpg" alt="610189" width="240" height="90" /></span>
</p></div></div><p>

FTFY.</p><p>I don&#39;t recognize that error, but from the <a href="http://stackoverflow.com/a/329195/149184">sounds of things</a> its related to exception handling. Though Allegro 5 is a C-based public API, they have resorted to using a little bit of C++ internally. Make sure your project is configured to build with g++ instead of gcc and see if that helps.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sat, 20 Feb 2016 01:21:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have g++ set as c++ default compiler. See the second post&#39;s image.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Sat, 20 Feb 2016 01:32:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would actually guess that Allegro should have been linked to the C++ runtime anyway and magically work, even if yours happened to be a pure C project... I&#39;m just guessing... I installed Code::Blocks in Debian to take a peek (been <i>years</i> since I&#39;ve seen it, let alone used it). I found it odd that it didn&#39;t differentiate between a C and C++ project. I can&#39;t seem to specify either. I don&#39;t know... <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> I&#39;m surprised it&#39;s building at all... Usually run-time just means the dynamic linker can&#39;t find something, but usually it&#39;s a library, not a symbol within a library... The linker should have caught that during the build process... <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sat, 20 Feb 2016 02:31:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;re mixing versions of MinGW. Your binaries from allegro.cc/files are built with a different version of MinGW than comes with CodeBlocks :
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
NOTE: The codeblocks-16.01mingw-setup.exe file includes additionally the GCC/G++ compiler and GDB debugger from TDM-GCC (version 4.9.2, 32 bit, SJLJ). The codeblocks-16.01mingw_fortran-setup.exe file includes additionally to that the GFortran compiler (TDM-GCC)
</p></div></div><p>

I offer Binaries for MinGW 4.8.1 and Allegro 5.1.X at the following two links if you&#39;re interested :</p><p><a href="https://sourceforge.net/projects/unofficialmingw/">https://sourceforge.net/projects/unofficialmingw/</a></p><p><a href="https://sourceforge.net/projects/unofficialallegro5distribution/">https://sourceforge.net/projects/unofficialallegro5distribution/</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 20 Feb 2016 04:05:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, that&#39;s what I thought, a version mismatch.</p><p>One other thing though:</p><p>I&#39;m not a MinGW user, but does this picture imply Allegro is being linked before the core MinGW libraries? </p><p><span class="remote-thumbnail"><span class="json">{"name":"0230c3312a296423081e16d12ac2ac06-1024.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/7\/37c7994b120f1b5200a2c98f034cd760.jpg","w":1024,"h":715,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/7\/37c7994b120f1b5200a2c98f034cd760"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/3/7/37c7994b120f1b5200a2c98f034cd760-240.jpg" alt="0230c3312a296423081e16d12ac2ac06-1024.jpg" width="240" height="167" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Sat, 20 Feb 2016 09:26:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I followed <a href="https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5">this wiki page</a> configuring Allegro. There is a picture, where MinGW libraries are linked after Allegro. The compiler does not throw any errors, so I guess, the linking order is good <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> . The compiler/library mismatch can be an error, I will try to do something with it, as you said.<br />Currently I&#39;m on linux, but I will update this post after testing.</p><p>UPDATE:<br />I tried with MinGW 4.8.1 from that unofficial build. I get type errors within the io.h.<br />Next I tried allegro-5.0.10-mingw-4.5.0 library with MinGW 4.5.4 - reference error to al_install_system. So what&#39;s next? I think I will get back to SDL, because this Allegro seems to be hard.</p><p>(I also updated the question with my specs)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Sat, 20 Feb 2016 15:28:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/616058/1020145#target">Laszlo Heim</a> said:</div><div class="quote"><p>
I tried with MinGW 4.8.1 from that unofficial build. I get type errors within the io.h.<br />Next I tried allegro-5.0.10-mingw-4.5.0 library with MinGW 4.5.4 - reference error to al_install_system. So what&#39;s next? I think I will get back to SDL, because this Allegro seems to be hard.</p><p>(I also updated the question with my specs) </p></div></div><p>
Don&#39;t give up on allegro. It&#39;s a really good library. You&#39;re just not used to setting things up right yet.</p><p>If you use MinGW 4.8.1 then you need to use allegro binaries built with MinGW 4.8.1 as well. That&#39;s why the 4.5.0 and 4.7.0 binaries don&#39;t work (and no, 4.7.0 won&#39;t work with 4.7.1 either). You can&#39;t mix versions like that. At the second link I gave you I have binaries for Allegro 5.1.13 built with MinGW 4.8.1. Allegro 5.1 has far more features and bug fixes than 5.0 does. You should use 5.1 if possible. If they make a new stable release for 5.0 I will make binaries for it, but I put my personal endorsement on 5.1.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 21 Feb 2016 01:09:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK. I will try to start everything from scratch. I will tell you if it works, but until Monday I can&#39;t test it. <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Sun, 21 Feb 2016 02:13:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Bump for reply.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 21 Feb 2016 11:06:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="https://www.allegro.cc/forums/thread/616058/1020176#target">Laszlo Heim</a> said:</div><div class="quote"><p>
<b>I will tell you if it works, but until Monday I can&#39;t test it.</b> <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div></div><p>

It is still Sunday in Romania. <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" /></p><div class="quote_container"><div class="title"><a href="https://www.allegro.cc/forums/thread/616058/1020145#target">Laszlo Heim</a> said:</div><div class="quote"><p>
Currently I&#39;m on linux, but I will update this post after testing.
</p></div></div><p>

Either I haven&#39;t been paying attention or you never said why you&#39;re working with Allegro in Windows. Are you just trying to make a Windows build because it&#39;s a popular platform? Or is there some other reason you aren&#39;t working with Allegro in Linux? It&#39;s generally much easier in Linux. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Mon, 22 Feb 2016 01:05:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So, I tried to use the that unofficial mingw release, but it does not work: it gives off64_t type error. I also downloaded the mingw version 4.7.0 to try it, but still nothing (just error: undefined reference to al_install_system), and I&#39;m not messing with versions. <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" /></p><p>There are more infos about the configuration in images.</p><p>Answer for bamccaig:<br />1) Yes, I never said why I&#39;m working on Windows with Allegro.cc, but you guessed it. I want to see that works on Windows, and after that can come Linux. Today, it&#39;s much easier to sell (not just selling, but free-to-play with paying possibilities) games. Okay, the time for this is very soon, because I never made a really complete game, but I think it&#39;s good to plan ahead. And I <b>want</b> to build for Linux too, but first Windows.</p><p>2) I forgot about some extra classes, so I didn&#39;t have time to do this Yesterday (Monday).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Tue, 23 Feb 2016 22:08:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My advice is rest assured Allegro is Windows compatible and works just fine. Windows is always a nightmare to setup builds though... If you feel yourself getting fed up then put the Windows build on hold and switch to Linux to just get some programming done! Allegro itself is mostly platform independent so you won&#39;t have to worry about incompatibility with Windows if you don&#39;t use platform specifics yourself. Once you have something that you actually want to release then you can worry about getting a Windows build made (you can also recruit help from the community if necessary).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Wed, 24 Feb 2016 07:47:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/616058/1020272#target">Laszlo Heim</a> said:</div><div class="quote"><p>
So, I tried to use the that unofficial mingw release, but it does not work: it gives off64_t type error.
</p></div></div><p>
Post the code that you&#39;re using. Post a minimal example that gives that error. What are the steps that you took to reproduce it? I compile with that MinGW version all the time and it never gives me any errors. And I&#39;ve used the Allegro binaries I built with it just fine as well. Are you including windows.h? Or some other conflicting headers? If you change the include order it may help.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 24 Feb 2016 09:26:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK, I tried on Linux. No errors! I used the same program, and it worked. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> So, should I build my own Allegro version from source on Windows too? <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /> It is harder than on Linux? (I mean, here I just used make commands, but on Windows I need to link a lot of libraries to Code::Blocks)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Thu, 25 Feb 2016 00:29:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>First you need to <i>build</i> a bunch of libraries on Windows. There&#39;s no package manager full of binaries for the dependencies. It is a real pain in the <span class="cuss"><span>ass</span></span>... Several people have done it so they&#39;d know better, but it&#39;s nothing like in Linux.</p><p>Maybe it would help if you started from scratch in Windows. Uninstall Allegro, uninstall Code::Blocks, uninstall MinGW. Start over. Make sure you install a matching Allegro for the MinGW that you install (with or without Code::Blocks)... <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Thu, 25 Feb 2016 00:55:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are you using the -std=c++11 flag anywhere? I read in another thread that was causing problems.</p><p>There&#39;s a discussion of your problem here :<br /><a href="https://sourceforge.net/p/mingw/bugs/2024/?page=0">https://sourceforge.net/p/mingw/bugs/2024/?page=0</a></p><p>I think the key is not to use anything that causes ANSI code checks.</p><p>And btw, you don&#39;t have to build any of those other libraries, because I&#39;ve already built all the dependencies for you in my Allegro binary package.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 25 Feb 2016 07:23:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hey! <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /> The -std=c++11 flag was the problem! It compiled and it worked without any error!</p><p>Thank you very much,<br />H. L.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Laszlo Heim)</author>
		<pubDate>Thu, 25 Feb 2016 20:59:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi! </p><p>Just to say that i had the same problem with Code::Blocks 16.x and Allegro 5.0.10-MinGW 4.7 in a new computer. I have fix it in one minute with the Binaries for MinGW 4.8.1 and Allegro 5.1.X from Edgar Reynaldo. I have to mention that i needed to copy-pasted the dlls from bin directory in SysWOW64 and it works!.</p><p>Thanks vey very much Edgar !!.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Battyhal)</author>
		<pubDate>Sun, 28 Feb 2016 17:06:53 +0000</pubDate>
	</item>
</rss>
