<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Problem compiling &quot;A4 code&quot; using A5</title>
		<link>http://www.allegro.cc/forums/view/608915</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 29 Nov 2011 13:24:15 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,</p><p>I &quot;updated&quot; the A4 code from a book to the point where running<br />gcc tankwar.c -o tankwar -I/usr/include/allegro5 -L/usr/lib -lalleg</p><p>yielded<br />tankwar.c: In function ‘main’:<br />tankwar.c:503: warning: assignment makes pointer from integer without a cast<br />/usr/bin/ld: cannot find -lalleg<br />collect2: ld returned 1 exit status</p><p>on Lucid Lynx.</p><p>So I went to the Allegro wiki for how to compile programs in 5.x.x and pasted<br />gcc tankwar.c -o tankwar -I/usr/include/allegro5 -L/usr/lib</p><p>But then my console &quot;blew up&quot; with:</p><p>Package allegro-5.0 was not found in the pkg-config search path.<br />Perhaps you should add the directory containing `allegro-5.0.pc&#39;<br />to the PKG_CONFIG_PATH environment variable<br />No package &#39;allegro-5.0&#39; found<br />tankwar.c: In function ‘drawtank’:<br />tankwar.c:20: warning: implicit declaration of function ‘al_draw_filled_rectangle’<br />tankwar.c: In function ‘explode’:<br />tankwar.c:139: warning: implicit declaration of function ‘rest’<br />tankwar.c: In function ‘updatebullet’:<br />tankwar.c:159: warning: implicit declaration of function ‘rect’<br />tankwar.c:180: warning: implicit declaration of function ‘getpixel’<br />tankwar.c:187: warning: implicit declaration of function ‘textprintf_ex’<br />tankwar.c: In function ‘score’:<br />tankwar.c:417: warning: implicit declaration of function ‘makecol’<br />tankwar.c: In function ‘main’:<br />tankwar.c:498: warning: implicit declaration of function ‘install_keyboard’<br />tankwar.c:499: warning: implicit declaration of function ‘install_timer’<br />tankwar.c:502: warning: implicit declaration of function ‘al_init_ttf_addon’<br />tankwar.c:503: warning: implicit declaration of function ‘al_load_ttf_font’<br />tankwar.c:503: warning: assignment makes pointer from integer without a cast<br />tankwar.c:536: warning: implicit declaration of function ‘keypressed’<br />tankwar.c:544: warning: implicit declaration of function ‘allegro_exit’<br />tankwar.c:496: warning: unused variable ‘display’<br />/tmp/cc2mF6FH.o: In function `drawtank&#39;:<br />tankwar.c:(.text+0x85): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0xb9): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0xf9): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0x12d): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0x16f): undefined reference to `al_draw_filled_rectangle&#39;<br />/tmp/cc2mF6FH.o:tankwar.c:(.text+0x1a3): more undefined references to `al_draw_filled_rectangle&#39; follow<br />/tmp/cc2mF6FH.o: In function `explode&#39;:<br />tankwar.c:(.text+0x615): undefined reference to `rest&#39;<br />tankwar.c:(.text+0x653): undefined reference to `al_draw_filled_rectangle&#39;<br />/tmp/cc2mF6FH.o: In function `updatebullet&#39;:<br />tankwar.c:(.text+0x6dd): undefined reference to `rect&#39;<br />tankwar.c:(.text+0x81b): undefined reference to `rect&#39;<br />tankwar.c:(.text+0x84d): undefined reference to `getpixel&#39;<br />tankwar.c:(.text+0x8de): undefined reference to `textprintf_ex&#39;<br />/tmp/cc2mF6FH.o: In function `checkpath&#39;:<br />tankwar.c:(.text+0x8fd): undefined reference to `getpixel&#39;<br />tankwar.c:(.text+0x913): undefined reference to `getpixel&#39;<br />tankwar.c:(.text+0x929): undefined reference to `getpixel&#39;<br />/tmp/cc2mF6FH.o: In function `getinput&#39;:<br />tankwar.c:(.text+0x1095): undefined reference to `al_wait_for_event&#39;<br />tankwar.c:(.text+0x11aa): undefined reference to `rest&#39;<br />/tmp/cc2mF6FH.o: In function `score&#39;:<br />tankwar.c:(.text+0x1210): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1257): undefined reference to `textprintf_ex&#39;<br />/tmp/cc2mF6FH.o: In function `setupdebris&#39;:<br />tankwar.c:(.text+0x1422): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1464): undefined reference to `al_draw_filled_rectangle&#39;<br />/tmp/cc2mF6FH.o: In function `setupscreen&#39;:<br />tankwar.c:(.text+0x149c): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x14de): undefined reference to `textprintf_ex&#39;<br />tankwar.c:(.text+0x14fa): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1522): undefined reference to `rect&#39;<br />tankwar.c:(.text+0x153e): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1566): undefined reference to `rect&#39;<br />/tmp/cc2mF6FH.o: In function `main&#39;:<br />tankwar.c:(.text+0x158d): undefined reference to `al_install_system&#39;<br />tankwar.c:(.text+0x1592): undefined reference to `install_keyboard&#39;<br />tankwar.c:(.text+0x1597): undefined reference to `install_timer&#39;<br />tankwar.c:(.text+0x15b0): undefined reference to `al_init_font_addon&#39;<br />tankwar.c:(.text+0x15b5): undefined reference to `al_init_ttf_addon&#39;<br />tankwar.c:(.text+0x15d1): undefined reference to `al_load_ttf_font&#39;<br />tankwar.c:(.text+0x1604): undefined reference to `keypressed&#39;<br />tankwar.c:(.text+0x1619): undefined reference to `rest&#39;<br />tankwar.c:(.text+0x1627): undefined reference to `allegro_exit&#39;<br />collect2: ld returned 1 exit status</p><p>Why doesn&#39;t my code compile?</p><p>TIA,<br />xtheunknown0
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Sun, 27 Nov 2011 06:11:09 +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/608915/938580#target">xtheunknown0</a> said:</div><div class="quote"><p> Package allegro-5.0 was not found in the pkg-config search path.<br /> Perhaps you should add the directory containing `allegro-5.0.pc&#39;<br /> to the PKG_CONFIG_PATH environment variable
</p></div></div></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 27 Nov 2011 06:12:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Apparently, no help.</p><p>I can give you a screenshot of this:<br />foo@foo:~/Documents$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig<br />foo@foo:~/Documents$ gcc tankwar.c -o tankwar $(pkg-config --libs allegro-5.0)<br />Package allegro-5.0 was not found in the pkg-config search path.<br />Perhaps you should add the directory containing `allegro-5.0.pc&#39;<br />to the PKG_CONFIG_PATH environment variable<br />No package &#39;allegro-5.0&#39; found<br />tankwar.c: In function ‘main’:<br />tankwar.c:503: warning: assignment makes pointer from integer without a cast<br />/tmp/ccZrCMPA.o: In function `drawtank&#39;:<br />tankwar.c:(.text+0x85): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0xb9): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0xf9): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0x12d): undefined reference to `al_draw_filled_rectangle&#39;<br />tankwar.c:(.text+0x16f): undefined reference to `al_draw_filled_rectangle&#39;<br />/tmp/ccZrCMPA.o:tankwar.c:(.text+0x1a3): more undefined references to `al_draw_filled_rectangle&#39; follow<br />/tmp/ccZrCMPA.o: In function `explode&#39;:<br />tankwar.c:(.text+0x615): undefined reference to `rest&#39;<br />tankwar.c:(.text+0x653): undefined reference to `al_draw_filled_rectangle&#39;<br />/tmp/ccZrCMPA.o: In function `updatebullet&#39;:<br />tankwar.c:(.text+0x6dd): undefined reference to `rect&#39;<br />tankwar.c:(.text+0x81b): undefined reference to `rect&#39;<br />tankwar.c:(.text+0x84d): undefined reference to `getpixel&#39;<br />tankwar.c:(.text+0x8de): undefined reference to `textprintf_ex&#39;<br />/tmp/ccZrCMPA.o: In function `checkpath&#39;:<br />tankwar.c:(.text+0x8fd): undefined reference to `getpixel&#39;<br />tankwar.c:(.text+0x913): undefined reference to `getpixel&#39;<br />tankwar.c:(.text+0x929): undefined reference to `getpixel&#39;<br />/tmp/ccZrCMPA.o: In function `getinput&#39;:<br />tankwar.c:(.text+0x1095): undefined reference to `al_wait_for_event&#39;<br />tankwar.c:(.text+0x11aa): undefined reference to `rest&#39;<br />/tmp/ccZrCMPA.o: In function `score&#39;:<br />tankwar.c:(.text+0x1210): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1257): undefined reference to `textprintf_ex&#39;<br />/tmp/ccZrCMPA.o: In function `setupdebris&#39;:<br />tankwar.c:(.text+0x1422): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1464): undefined reference to `al_draw_filled_rectangle&#39;<br />/tmp/ccZrCMPA.o: In function `setupscreen&#39;:<br />tankwar.c:(.text+0x149c): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x14de): undefined reference to `textprintf_ex&#39;<br />tankwar.c:(.text+0x14fa): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1522): undefined reference to `rect&#39;<br />tankwar.c:(.text+0x153e): undefined reference to `makecol&#39;<br />tankwar.c:(.text+0x1566): undefined reference to `rect&#39;<br />/tmp/ccZrCMPA.o: In function `main&#39;:<br />tankwar.c:(.text+0x158d): undefined reference to `al_install_system&#39;<br />tankwar.c:(.text+0x1592): undefined reference to `install_keyboard&#39;<br />tankwar.c:(.text+0x1597): undefined reference to `install_timer&#39;<br />tankwar.c:(.text+0x15b0): undefined reference to `al_init_font_addon&#39;<br />tankwar.c:(.text+0x15b5): undefined reference to `al_init_ttf_addon&#39;<br />tankwar.c:(.text+0x15d1): undefined reference to `al_load_ttf_font&#39;<br />tankwar.c:(.text+0x1604): undefined reference to `keypressed&#39;<br />tankwar.c:(.text+0x1619): undefined reference to `rest&#39;<br />tankwar.c:(.text+0x1627): undefined reference to `allegro_exit&#39;<br />collect2: ld returned 1 exit status
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Sun, 27 Nov 2011 09:51:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Have you installed Allegro 5? Does the pc file exist in that location?</p><p>Note that many of the errors are references to Allegro 4 functions, so even when you get Allegro 5 working it still won&#39;t compile.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sun, 27 Nov 2011 10:52:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think it&#39;s because I deleted the allegro-5.0 directory that svn created.</p><p>One thing that I can&#39;t apparently &quot;fix&quot; on my own is getpixel(). What is the &quot;equivalent&quot; in A5? I know that the answer to that may be pretty big, so I&#39;ll also ask: is it where for simple games (a main.c and a header) you declare a &quot;screen&quot; in the header and initialise it somewhere in main.c then start using it other functions? and how do I set up a screen?</p><p>BTW, so why was a &quot;screen&quot; argument removed from graphics primitives functions? I thought I could get away with using al_draw_[shape] functions but I need a &quot;screen&quot; for collision detection via getpixel...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Sun, 27 Nov 2011 13:13:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The drawing target (which will also be used with <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_pixel"><span class="a">al_get_pixel</span></a></span>) in Allegro 5 is part of a stored state. You set it with <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_target_bitmap"><span class="a">al_set_target_bitmap</span></a></span> and then just call drawing functions as necessary, and they will all draw to the most recent drawing target that you have set with that function.</p><p>There is no &#39;screen&#39; in A5, but semantically, the backbuffer is similar. You draw everything you want to display to it, and then call <span class="source-code"><a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a></span>.</p><p>Also, you will probably want to rework your collision detection, because reading from video memory is slow (if you read from the backbuffer, or another video bitmap). Depends on how many pixels you need to read though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 28 Nov 2011 01:18:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve got the code to the point where it compiles but it aborts due to loading a font.<br />I tried the code in the wiki about fonts (<a href="http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Addons/Fonts">http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Addons/Fonts</a>) and it also</p><p>foo: /home/blah/allegro-5.0/addons/font/text.c:73: al_draw_ustr: Assertion `font&#39; failed.</p><p>Why is this?</p><p>TIA,<br />xtheunknown0
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Mon, 28 Nov 2011 10:38:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Did you call <span class="source-code"><a href="http://www.allegro.cc/manual/al_init_font_addon"><span class="a">al_init_font_addon</span></a></span> and <span class="source-code"><a href="http://www.allegro.cc/manual/al_init_ttf_addon"><span class="a">al_init_ttf_addon</span></a></span> before loading your font?</p><p>Also, did you check to make sure the font returned by <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_ttf_font"><span class="a">al_load_ttf_font</span></a></span> returned a non-zero value? You may have a problem with the current working directory being different than the one your executable is expecting.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 28 Nov 2011 10:59:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That is indeed the problem (returning zero). What do I do about it?</p><p>TIA,<br />xtheunknown0
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Mon, 28 Nov 2011 12:27:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>See <a href="http://wiki.allegro.cc/index.php?title=Loading_Resources_%28Troubleshooting%29">http://wiki.allegro.cc/index.php?title=Loading_Resources_%28Troubleshooting%29</a><br />and <a href="http://wiki.allegro.cc/index.php?title=Loading_Resources_(Troubleshooting)#Fix_the_Path">http://wiki.allegro.cc/index.php?title=Loading_Resources_(Troubleshooting)#Fix_the_Path</a> for clues.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 28 Nov 2011 12:37:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think what wasn&#39;t clear from the start was the significance of having to load a font (, whereas my A4 book doesn&#39;t need to). Following from that is having an idea where A5 hunts for files.</p><p>So I read parts of the manual and I try<br />printf(&quot;%s\n&quot;, al_path_cstr(al_get_standard_path(ALLEGRO_RESOURCES_PATH), &#39;/&#39;));<br />font = al_load_ttf_font(&quot;DejaVuSans.ttf&quot;, 72, 0);</p><p>Now DejaVuSans.ttf is in my Documents/ where tankwar.c is (as well), so why is !font still &quot;true&quot;?</p><p>TIA,<br />xtheunknown0
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Tue, 29 Nov 2011 04:10:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It doesn&#39;t look anywhere for a font file, except for the exact spot you tell it to.</p><p>Your code does nothing but tries to load &quot;DejaVuSans.ttf&quot; from the current working directory. Your call to <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span><span class="k2">)</span></span> is meaningless. Read Edgar&#39;s link and follow the instructions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 29 Nov 2011 04:25:49 +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/608915/938680#target">xtheunknown0</a> said:</div><div class="quote"><p>
So I read parts of the manual and I try
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"%s\n"</span>, <a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span>, <span class="s">'/'</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/font"><span class="a">font</span></a> <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_ttf_font"><span class="a">al_load_ttf_font</span></a><span class="k2">(</span><span class="s">"DejaVuSans.ttf"</span>, <span class="n">72</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
Now DejaVuSans.ttf is in my <br />Documents/ where tankwar.c is (as well), so why is !font still &quot;true&quot;?TIA,<br />xtheunknown0
</p></div></div><p>

Allegro doesn&#39;t search from anywhere except from the current working directory. That might not be the same as what is returned by <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span></span>. To be sure, you have to set the current working directory yourself like the wiki showed you :
</p><div class="source-code snippet"><div class="inner"><pre>ALLEGRO_PATH <span class="k3">*</span>path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_append_path_component"><span class="a">al_append_path_component</span></a><span class="k2">(</span>path, <span class="s">"resources"</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_change_directory"><span class="a">al_change_directory</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span>path, <span class="s">'/'</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>  <span class="c">// change the working directory</span>
<a href="http://www.allegro.cc/manual/al_destroy_path"><span class="a">al_destroy_path</span></a><span class="k2">(</span>path<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 29 Nov 2011 04:30:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre>ALLEGRO_PATH <span class="k3">*</span>path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_append_path_component"><span class="a">al_append_path_component</span></a><span class="k2">(</span>path, <span class="s">"resources"</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_change_directory"><span class="a">al_change_directory</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span>path, <span class="s">'/'</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>  <span class="c">// change the working directory</span>
<a href="http://www.allegro.cc/manual/al_destroy_path"><span class="a">al_destroy_path</span></a><span class="k2">(</span>path<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>I suppose that is the simplest way. I don&#39;t know why but the way I think of first is:</p><div class="source-code snippet"><div class="inner"><pre>ALLEGRO_PATH <span class="k3">*</span>res_path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_append_path_component"><span class="a">al_append_path_component</span></a><span class="k2">(</span>res_path, <span class="s">"resources"</span><span class="k2">)</span><span class="k2">;</span>

ALLEGRO_PATH <span class="k3">*</span>file_path <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_clone_path"><span class="a">al_clone_path</span></a><span class="k2">(</span>res_path<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_set_path_filename"><span class="a">al_set_path_filename</span></a><span class="k2">(</span>file_path, <span class="s">'filename.ext'</span><span class="k2">)</span><span class="k2">;</span>

<a href="http://www.allegro.cc/manual/ALLEGRO_FONT"><span class="a">ALLEGRO_FONT</span></a> <span class="k3">*</span><a href="http://www.allegro.cc/manual/font"><span class="a">font</span></a> <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_font"><span class="a">al_load_font</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span>file_path, <span class="s">'/'</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_destroy_path"><span class="a">al_destroy_path</span></a><span class="k2">(</span>file_path<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

In the end its the same, and the first is easier.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 29 Nov 2011 04:33:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, I think I&#39;ve tried - please tell me if I haven&#39;t:</p><p>ALLEGRO_PATH *path = al_get_standard_path(ALLEGRO_RESOURCES_PATH);<br />al_append_path_component(path, &quot;resources&quot;);<br />al_change_directory(al_path_cstr(path, &#39;/&#39;));  // change the working directory<br />font = al_load_ttf_font(&quot;DejaVuSans.ttf&quot;, 72, 0);<br />if (!font) {<br />    printf(&quot;Error loading DejaVuSans.ttf.\n&quot;);<br />    return 1;<br />}<br />al_destroy_path(path);</p><p>I still have the same problem, and there is now a resources/ (storing the ttf) in Documents/</p><p>What is it that I do not get?<br />TIA,<br />xtheunknown0
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Tue, 29 Nov 2011 08:30:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is your executable file in the Documents folder? If so, it should work. If it still does not work, link to the debugging version of allegro. Then your program will produce a file called allegro.log and you can look at it for clues as to why the font didn&#39;t load. You&#39;re sure you initialized both the font addon and the ttf addon before loading?</p><p>Code goes in &lt;code&gt;code goes here...&lt;/code&gt; tags.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 29 Nov 2011 09:03:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OH right, RESOURCES is actually the exe path on windows I think. You want <span class="source-code">ALLEGRO_USER_DOCUMENTS_PATH</span> for your &quot;My Documents&quot; folder.</p><p><span class="source-code">ALLEGRO_RESOURCES_PATH</span> is actually the full path to the directory your executable is in. So if you use that, you put your data in the same dir as the exe.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 29 Nov 2011 10:19:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How do I create an allegro.log?</p><p>Sorry for being a nuisance.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Tue, 29 Nov 2011 11:06:36 +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/608915/938701#target">xtheunknown0</a> said:</div><div class="quote"><p> What is it that I do not get?
</p></div></div><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_change_directory"><span class="a">al_change_directory</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span>path, <span class="s">'/'</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// change the working directory</span>
<a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"The path: %s\n"</span>, <a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span>path, <span class="s">'/'</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
Is the TTF there in that path that is displayed in your console window?</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/608915/938705#target">xtheunknown0</a> said:</div><div class="quote"><p> How do I create an allegro.log?
</p></div></div><p>You have to link with the Allegro debug library and define something like ALLEGRO_DEBUG. But that&#39;s really not necessary. Debugging is simple: start with the obvious or simple and continue on until you find the problem. There are only a few reasons why it would fail:</p><ol><li><p>You didn&#39;t initialize the font and ttf addons, in that order.
</p></li><li><p>The TTF file isn&#39;t in that path specified.
</p></li><li><p>The file is corrupt.
</p></li><li><p>Allegro or the TTF library has a bug.</p></li></ol><p>9 out of 9 times you&#39;ll get the problem figured out after the first and second points are corrected.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 29 Nov 2011 11:23:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I believe I&#39;ve tried the first two - I&#39;m not sure how to help myself now.</p><p><a href="https://sites.google.com/site/xtheunknown0/allegro">https://sites.google.com/site/xtheunknown0/allegro</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xtheunknown0)</author>
		<pubDate>Tue, 29 Nov 2011 12:56:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The code in the link you just posted is clearly missing a call to <span class="source-code"><a href="http://www.allegro.cc/manual/al_init_ttf_addon"><span class="a">al_init_ttf_addon</span></a></span> before you load your font. <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 29 Nov 2011 13:24:15 +0000</pubDate>
	</item>
</rss>
