<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Code::Blocks Linker Problem</title>
		<link>http://www.allegro.cc/forums/view/605985</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 14 Jan 2011 03:22:36 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello everyone,<br />im new to Allegro and have a question concerning setting up my IDE.<br />After fallowing the introductions in this thread</p><p><a href="http://www.allegro.cc/forums/thread/605784">http://www.allegro.cc/forums/thread/605784</a></p><p>i tried to compile this code</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;stdio.h&gt;</span>
<span class="number">  2</span><span class="p">#include &lt;allegro5/allegro.h&gt;</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><span class="k3">*</span>argv<span class="k2">)</span>
<span class="number">  5</span><span class="k2">{</span>
<span class="number">  6</span>   <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span>display <span class="k3">=</span> NULL<span class="k2">;</span>
<span class="number">  7</span>
<span class="number">  8</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="k2">{</span>
<span class="number">  9</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_345.html" target="_blank">fprintf</a><span class="k2">(</span>stderr, <span class="s">"failed to initialize allegro!\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>      <span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span>
<span class="number"> 11</span>   <span class="k2">}</span>
<span class="number"> 12</span>
<span class="number"> 13</span>   display <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>   <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span>display<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 15</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_345.html" target="_blank">fprintf</a><span class="k2">(</span>stderr, <span class="s">"failed to create display!\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span>      <span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span>
<span class="number"> 17</span>   <span class="k2">}</span>
<span class="number"> 18</span>
<span class="number"> 19</span>   <a href="http://www.allegro.cc/manual/al_clear_to_color"><span class="a">al_clear_to_color</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span>
<span class="number"> 21</span>   <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>
<span class="number"> 23</span>   <a href="http://www.allegro.cc/manual/al_rest"><span class="a">al_rest</span></a><span class="k2">(</span><span class="n">10</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 24</span>
<span class="number"> 25</span>   <a href="http://www.allegro.cc/manual/al_destroy_display"><span class="a">al_destroy_display</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 26</span>
<span class="number"> 27</span>   <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 28</span><span class="k2">}</span>
</div></div><p>

and got these errors</p><p>Compiling: main.cpp<br />Linking console executable: bin\Debug\Allegro_Test.exe<br />obj\Debug\main.o: In function `main&#39;:<br />E:/C++/Projekte/Allegro_Test/Allegro_Test/main.cpp:8: undefined reference to `al_install_system&#39;<br />E:/C++/Projekte/Allegro_Test/Allegro_Test/main.cpp:13: undefined reference to `al_create_display&#39;<br />E:/C++/Projekte/Allegro_Test/Allegro_Test/main.cpp:19: undefined reference to `al_map_rgb&#39;<br />E:/C++/Projekte/Allegro_Test/Allegro_Test/main.cpp:19: undefined reference to `al_clear_to_color&#39;<br />E:/C++/Projekte/Allegro_Test/Allegro_Test/main.cpp:21: undefined reference to `al_flip_display&#39;<br />E:/C++/Projekte/Allegro_Test/Allegro_Test/main.cpp:23: undefined reference to `al_rest&#39;<br />E:/C++/Projekte/Allegro_Test/Allegro_Test/main.cpp:25: undefined reference to `al_destroy_display&#39;<br />collect2: ld returned 1 exit status<br />Process terminated with status 1 (0 minutes, 5 seconds)<br />7 errors, 0 warnings</p><p>In this thread <br /><a href="http://www.allegro.cc/forums/thread/605768">http://www.allegro.cc/forums/thread/605768</a><br />Matthew Leverton said that liballegro-5.0.0-RC2-md.a (liballegro-5.0.0-RC4-md.a in my case) needs to be linked.<br />Isn&#39;t that already done by adding the allegro\lib path to the Linker Directories?<br />If not how do i link it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (_Xero_)</author>
		<pubDate>Thu, 06 Jan 2011 23:00:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Getting Allegro to play nice or any library for that matter always seems to make me stumble too. I searched and read all kind of material over the internet to try and get RC4 to work but just can&#39;t seem to figure out what I&#39;m doing wrong. I have read through the various threads here and none of them seem to help. Just a note I&#39;ve pretty much done the same as Xero and am still having some of the same issues.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Hedgie)</author>
		<pubDate>Fri, 07 Jan 2011 02:38:20 +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/605985/897399#target">_Xero_</a> said:</div><div class="quote"><p> Isn&#39;t that already done by adding the allegro\lib path to the Linker Directories?
</p></div></div><p>No. That just tells the compiler where to look for libraries that you explicitly specify later.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> If not how do i link it?
</p></div></div><p>Add it to the list of libraries to link. Your IDE will have that option somewhere.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 07 Jan 2011 02:41:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks Matthew,<br />I found the option under Project -&gt; Build Options -&gt; Linker Settings</p><p>@Hedgie: If you use Code::Blocks</p><p>Go to Settings / Compiler and Debugger / Global compiler settings<br />Go to Search Directories tab<br />Under Compiler, add c:\allegro\include<br />Under Linker, add c:\allegro\lib<br />Go to Toolchain executables tabs<br />Under Additional Paths, add c:\allegro\bin</p><p>and then link the liballegro-5.0.0-RC4-md.a as i said above</p><p>good luck^^
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (_Xero_)</author>
		<pubDate>Fri, 07 Jan 2011 18:01:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay so part of the problem is figured out if I use the library file  &quot;liballegro-5.0.0-RC4-md.a&quot; I can get the first allegro 5 tutorial(The display one) to compile just fine. But what I&#39;m really going after is trying to use &quot;liballegro-5.0.0-RC4-monolith-static-mt.a&quot; and &quot;liballegro-5.0.0-RC4-monolith-static-mt-debug.a&quot; and when attempt to compile using one of the two file Codeblocks seems to treat the file differently. I even make sure to define ALLEGRO_STATICLINK before all my headers and get various errors.</p><p>This particular one is straight out of my build log. <br />to `glGetString@4&#39;<br />d:/Libraries/build/allegro/src/allegro-5.0.x/allegro-5.0.x/src/win/wgl_disp.c:1044: undefined reference to `glGetString@4&#39;<br />Process terminated with status 1 (0 minutes, 1 seconds)<br />50 errors, 0 warnings</p><p>The other 50 errors <a href="http://pastebin.com/qeSj8Wq3">Pastebin</a></p><p>Note: The libraries aren&#39;t located on my D: drive they&#39;re in my J: drive making me wonder if there is something wrong with the library itself.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Hedgie)</author>
		<pubDate>Mon, 10 Jan 2011 06:50:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Please help, Same problem. I&#39;d be willing to switch IDE&#39;s if anyone knows one that plays nice with allegro other then Dev C++.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fworg64)</author>
		<pubDate>Mon, 10 Jan 2011 07:11:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>When linking statically, I think there are several other libraries that you have to link to as well. For instance, it looks like you&#39;re not linking to the OpenGL library according to your undefined reference to glGetString@4. It looks like there are other libraries you have to link to as well according to your log on pastebin.</p><p>Can someone post a list of the extra libraries that you need to link to when you&#39;re linking with Allegro5 statically please? I googled for them, but came up with nothing in the manual or documentation or forums.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 10 Jan 2011 07:16:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Something like -lglu32 -lglut32 -lopengl32.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/605985/897898#target">Fworg64</a> said:</div><div class="quote"><p> I&#39;d be willing to switch IDE&#39;s if anyone knows one that plays nice with allegro other then Dev C++.
</p></div></div><p>This has nothing to do with Dev-C++, but Code::Blocks is generally preferred over it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Mon, 10 Jan 2011 07:32:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Another note to put in here is I was using TDM-mingw and while everything has compile just fine, it seems that Allegro 5 and TDM-mingw is incompatible in some way at the moment. I&#39;m getting the official Mingw right now but if this isn&#39;t some kind of mistake on my end maybe this needs to be documented?</p><p>Okay nevermind, I&#39;m getting the same error with mingw as with TDG-mingw. The program compiles just fine but when I go to run it I get a window with this message &quot;The procedure entry point __gxx_personality_v0 could not be located on the dynamic link library libstdc++-6.dll&quot; I really have no clue what this message is trying to explain at all. This is the first of this kind of error I&#39;ve ever seen. Any advice?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Hedgie)</author>
		<pubDate>Mon, 10 Jan 2011 09:02:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>@Matthew Leverton<br />My bad I phrased that wrong <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> , I do use code::blocks but I remember Dev C++ had some nice integrated library installing feature. I have the exact same problem as Xero
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fworg64)</author>
		<pubDate>Mon, 10 Jan 2011 09:38:56 +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/605985/897923#target">Fworg64</a> said:</div><div class="quote"><p>
I have the exact same problem as Xero
</p></div></div><p>
If you are getting undefined references during the linking process, then you are not linking all of the libraries that you should be. What undefined references are you getting?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 10 Jan 2011 09:58:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok i lied my problems different, it was the same for a while though nut  now its this</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">#define ALLEGRO_STATICLINK 1</span>
<span class="number">  2</span><span class="p">#include &lt;allegro5/allegro.h&gt;</span>
<span class="number">  3</span>
<span class="number">  4</span><span class="k1">int</span> main<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="number">  5</span><span class="k2">{</span>
<span class="number">  6</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="number">  8</span>    <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span>display <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">640</span>, <span class="n">480</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  9</span>
<span class="number"> 10</span>    <a href="http://www.allegro.cc/manual/al_clear_to_color"><span class="a">al_clear_to_color</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">150</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 11</span>
<span class="number"> 12</span>    <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>
<span class="number"> 14</span>    <a href="http://www.allegro.cc/manual/al_rest"><span class="a">al_rest</span></a><span class="k2">(</span><span class="n">5</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>
<span class="number"> 16</span>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 17</span><span class="k2">}</span>
<span class="number"> 18</span><a href="http://www.allegro.cc/manual/END_OF_MAIN"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span>
</div></div><p>

and the errors i get are
</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>main.cpp<span class="k3">|</span><span class="n">8</span><span class="k3">|</span>warning: unused variable <span class="s">'display'</span><span class="k3">|</span>
<span class="number"> 2</span>C:\C<span class="k3">+</span><span class="k3">+</span> projects\Alleg5test\main.cpp<span class="k3">|</span><span class="n">18</span><span class="k3">|</span>error: expected constructor, destructor, <span class="k1">or</span> type conversion at end of input<span class="k3">|</span>
</div></div><p>

I can guess the first one is just because i didn&#39;t say display anywhere else in main but I&#39;m at a loss for that last one, I&#39;ve tried with and without a semicolon but to no avail.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fworg64)</author>
		<pubDate>Mon, 10 Jan 2011 10:05:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t use <span class="source-code"><a href="http://www.allegro.cc/manual/END_OF_MAIN"><span class="a">END_OF_MAIN</span></a></span> with Allegro 5.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Mon, 10 Jan 2011 10:13:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank you kind sir,
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fworg64)</author>
		<pubDate>Mon, 10 Jan 2011 10:20:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://">Edgar Reynaldo</a> said:</div><div class="quote"><p>Can someone post a list of the extra libraries that you need to link to when you&#39;re linking with Allegro5 statically please?</p></div></div><p>

We&#39;re more or less on the same problem... See this threat... <a href="http://www.allegro.cc/forums/thread/606040/0">http://www.allegro.cc/forums/thread/606040/0</a></p><p>Michał Cichoń Once says... Here <a href="http://www.allegro.cc/forums/thread/605692">http://www.allegro.cc/forums/thread/605692</a></p><div class="quote_container"><div class="title"><a href="http://">Michał Cichoń</a> said:</div><div class="quote"><p>

Assume you&#39;re using MinGW GCC 4.5.0. To compile Allegro as static library with static run-time libraries use following switches:</p><p>Switches for source files:<br />-s -DALLEGRO_SRC -DALLEGRO_STATICLINK -DALLEGRO_LIB_BUILD<br />Switches for linker:<br />-lgcc_eh -static-libgcc -static-libstdc++</p><p>Switches for executable:<br />Switches for source files:<br />-s -DALLEGRO_STATICLINK<br />Switches for linker:</p><p>-lgcc_eh -static-libgcc -static-libstdc++</p><p>Libraries:<br />Allegro and add-ons (list all your application, you may list all they will be ignored if not used):<br />allegro-5.1.0-static-mt<br />allegro_audio-5.1.0-static-mt<br />...</p><p>Direct dependencies (libraries used by Allegro):</p><p>libFLAC-1.2.1-static-mt<br />libvorbisfile-1.2.3-static-mt<br />libvorbis-1.2.3-static-mt<br />libogg-1.1.4-static-mt<br />dumb-0.9.3-static-mt<br />zlib-1.2.5-static-mt<br />physfs-2.0.0-static-mt<br />freetype-2.4.2-static-mt</p><p>Indirect dependencies (DLL&#39;s availabe in system):</p><p>gdiplus<br />uuid<br />kernel32<br />winmm<br />psapi<br />opengl32<br />glu32<br />user32<br />comdlg32<br />gdi32<br />shell32<br />ole32<br />advapi32<br />ws2_32</p></div></div><p>

If someone knows how to use this information please post it... <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> I&#39;m using Code Block... </p><p>I manually linked to the Indirect Dependencies, which are all in the System32 folder... But I couldn&#39;t find &quot;uuid.dll&quot; and I still getting errors... I&#39;m using the pre-build static binaries...</p><p>I did this...</p><p>http://www.cerebrospain.com/find5.gif</p><p>PS: You must link manually all those libraries if you want to compile statically...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Fri, 14 Jan 2011 03:22:36 +0000</pubDate>
	</item>
</rss>
