<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Compiling allegro programs, under linux terminal</title>
		<link>http://www.allegro.cc/forums/view/597189</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 02 Aug 2008 07:45:14 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have read the readme, and instructions, and have successfully compiled some allegro programs.</p><p>But will someone kindly, re describe how to do a command line compilation of a program written with allegro functions, using gcc?<br />How to include it in Fedora Eclipse ?<br />I tried to inscude it into fedora, linked the libs, but the -lalleg link is giving an error.<br />Please re describe the process. And let me know why are those links are used, and what they work for.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Phoxis)</author>
		<pubDate>Mon, 28 Jul 2008 20:36:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>try on linking instead of -lalleg, using adding `allegro-config --libs` (use the proper quotes, the one that&#39;s on the same key as ~.  Check out allegro-config for other options (such as cflags, cppflags, and libs)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cody Harris)</author>
		<pubDate>Mon, 28 Jul 2008 20:56:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>IIRC, there is a command that &quot;registers&quot; libraries so that the linker can find them (according to the man page it seems like libraries are cached, likely for speed, and in order to find them the linker requires you to cache them). Until you do this the linker won&#39;t find the libraries you have installed since it was last executed. Something like <tt>ldconfig</tt> or something...</p><p> <tt>ldconfig</tt></p><p>I haven&#39;t been using Linux enough recently to be sure, but that sounds right. <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" /> Always check the man page before executing a command, however. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> There appears to be a configuration file for <tt>ld</tt> (the linker) called <tt>/etc/ld.so.conf</tt> so you might want to check that out as  well (to make sure the Allegro libraries are in one of the specified directories).</p><p>As Cody Harris said, there is a script in the Linux installation of Allegro that automatically outputs library options. It is called <tt>allegro-config</tt>. Therefore, you can use either back-tick syntax (`<i>command</i>`) or dollar-sign parenthesis syntax (<tt>$(<i>command</i>)</tt>) (depending on which shell you&#39;re using) to automatically insert the correct library options onto your command-line.</p><p> <tt>gcc <i>options</i> `allegro-config --libs` <i>source_files</i></tt><br /> <tt>gcc <i>options</i> $(allegro-config --libs) <i>source_files</i></tt></p><p>IIRC, <tt>$(<i>command</i>)</tt> is the new &quot;right&quot; way, but <tt>`<i>command</i>`</tt> is compatible with more/older shells.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Mon, 28 Jul 2008 21:53:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I always use <br />g++ main.c `allegro-config --libs`</p><p>assuming that your main source file is named main.c<br /> then run it with ./a.out<br />hope that helps.</p><p>can&#39;t help you with fedora, though. sorry.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MilesPrower)</author>
		<pubDate>Thu, 31 Jul 2008 23:05:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I use a Speedhack makefile, with a few modifications for profiling and debugging.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trezker)</author>
		<pubDate>Fri, 01 Aug 2008 19:49:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>this is the (imo) proper set of commands:</p><p>debug:
</p><div class="source-code snippet"><div class="inner"><pre>gcc <span class="k3">-</span>W <span class="k3">-</span>Wall <span class="k3">-</span>ggdb3 <span class="k3">-</span>c file.c
gcc file.o <span class="k3">-</span>o program `allegro-config <span class="k3">-</span><span class="k3">-</span>libs`
</pre></div></div><p>
release:
</p><div class="source-code snippet"><div class="inner"><pre>gcc <span class="k3">-</span>W <span class="k3">-</span>Wall <span class="k3">-</span>c file.c
gcc <span class="k3">-</span>s file.o <span class="k3">-</span>o program `allegro-config <span class="k3">-</span><span class="k3">-</span>libs`
</pre></div></div><p>
then run with <tt>./program</tt>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 01 Aug 2008 20:10:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Not sure if it adds much but if you want to link against allegro&#39;s debug library use:</p><div class="source-code snippet"><div class="inner"><pre>gcc <span class="k3">-</span>W <span class="k3">-</span>Wall <span class="k3">-</span>ggdb3 <span class="k3">-</span>c file.c
gcc file.o <span class="k3">-</span>o program `allegro-config <span class="k3">-</span><span class="k3">-</span>libs debug`
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nutter)</author>
		<pubDate>Fri, 01 Aug 2008 20:45:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for the replies. They would help me very much
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Phoxis)</author>
		<pubDate>Sat, 02 Aug 2008 07:45:14 +0000</pubDate>
	</item>
</rss>
