<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>How to call function al_draw_multiline_text?</title>
		<link>http://www.allegro.cc/forums/view/618234</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 14 Sep 2020 04:15:58 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello. I am running latest version of Allegro.</p><p>I see this function in docs:</p><p><a href="https://liballeg.org/a5docs/trunk/font.html#al_draw_multiline_text">https://liballeg.org/a5docs/trunk/font.html#al_draw_multiline_text</a></p><p>In my code I have at least:</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;allegro5/allegro_font.h&gt;</span>
<span class="number"> 2</span><span class="p">#include &lt;allegro5/allegro_ttf.h&gt;</span>
<span class="number"> 3</span>...
<span class="number"> 4</span><a href="http://www.allegro.cc/manual/al_init_font_addon"><span class="a">al_init_font_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 5</span><a href="http://www.allegro.cc/manual/al_init_ttf_addon"><span class="a">al_init_ttf_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 6</span>...
</div></div><p>

When I compile, I am told &quot;undefined reference to &lt;al_draw_multiline_text&gt;&quot;.</p><p>How do I use that function?</p><p>I can use al_draw_text okay. If I can get built-in newlines that helps a lot.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (thatrabbit)</author>
		<pubDate>Thu, 10 Sep 2020 05:00:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Does <i>ex_font_multiline</i> from the Allegro examples work?.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kenmasters1976)</author>
		<pubDate>Thu, 10 Sep 2020 20:42:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You also need to link their library. (-lallegro_font -lallegro_ttf)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RmBeer2)</author>
		<pubDate>Thu, 10 Sep 2020 21:37:18 +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/618234/1047278#target">RmBeer2</a> said:</div><div class="quote"><p> You also need to link their library. (-lallegro_font -lallegro_ttf)</p></div></div><p>I think it&#39;s safe to assume he&#39;s linking correctly if <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span><span class="k2">)</span></span> is working.</p><p>My low-tech suggestion - are you sure you spelled the function correctly?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Fri, 11 Sep 2020 05:20:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Which version of Allegro do you have installed? Seems that function was added in 5.1.9. <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /> If you spelled it correctly and <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a></span> works then too old of a distribution seems like the only explanation left. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 11 Sep 2020 07:35:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Also possible you may be using the wrong function signature, which can result in an undefined reference.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 11 Sep 2020 11:12:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s true, but only if he forward declared the signature himself. Otherwise, the compiler would choke before the linker was invoked. <img src="http://www.allegro.cc/forums/smileys/kiss.gif" alt=":-*" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 11 Sep 2020 19:11:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What signature?? i get lost...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RmBeer2)</author>
		<pubDate>Fri, 11 Sep 2020 19:58:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>al_draw_multiline_text was added in Allegro 5.1.9. You must be linking to an old version of allegro, or not linking to the allegro font addon.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 12 Sep 2020 00:47:24 +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/618234/1047292#target">RmBeer2</a> said:</div><div class="quote"><p>
What signature?? i get lost...
</p></div></div><p>

</p><div class="source-code"><div class="toolbar"><span class="name">f1.cpp</span><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="k1">void</span> f1<span class="k2">(</span><span class="k1">int</span> <span class="k3">*</span> x<span class="k2">)</span>
<span class="number"> 2</span><span class="k2">{</span>
<span class="number"> 3</span>    <span class="k3">*</span>x <span class="k3">*</span><span class="k3">=</span> <span class="n">2</span><span class="k2">;</span>
<span class="number"> 4</span><span class="k2">}</span>
</div></div><p>

</p><div class="source-code"><div class="toolbar"><span class="name">main.cpp</span><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="k1">void</span> f1<span class="k2">(</span><span class="k1">const</span> <span class="k1">char</span> <span class="k3">*</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  2</span>
<span class="number">  3</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">  4</span><span class="k2">{</span>
<span class="number">  5</span>    f1<span class="k2">(</span><span class="s">"Hello, World!\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span>
<span class="number">  7</span>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number">  8</span><span class="k2">}</span>
</div></div><p>

</p><pre class="terminal">g++ -Wall f1.cpp -c
g++ -Wall main.cpp -c
g++ -Wall f1.o main.o
main.o: In function `main&#39;:
main.cpp:(.text+0x17): undefined reference to `f1(char const*)&#39;
collect2: error: ld returned 1 exit status</pre><p>

<span class="source-code">f1</span> is a real function, and it has been linked, but the signature doesn&#39;t match the one expected by <tt>main.o</tt>.</p><p>Interesting to note that C did not care at all. It compiled and linked without errors. Then it segfaulted at runtime. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Sat, 12 Sep 2020 01:43:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>f1.cpp: _Z2f1Pi<br />main.cpp: _Z2f1PKc</p><p>This&#39;s a signature? i see...</p><p>Saying they have different parameters looks less confusing. Although this is what makes C++ stackable with the same function name.</p><p>In that case he should show what is the source code, the compilation line and the compilation output. To be more sure.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RmBeer2)</author>
		<pubDate>Sat, 12 Sep 2020 10:02:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s a great example, BAM.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Sat, 12 Sep 2020 10:36:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wow. Thank-you for all the replies! I should have checked back sooner.</p><p>I realized multi-line would not help me in this case. Still it is good to know it exists, and I will refer back here when the time comes.</p><p>Cheers all!</p><p>-- edit</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/618234/1047298#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> You must be linking to an old version of allegro</p></div></div><p>Was correct. I am using 5.0.10. Time to upgrade.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (thatrabbit)</author>
		<pubDate>Sun, 13 Sep 2020 11:31:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have some binaries for Allegro 5.2.5 and MinGW-W64 gcc 8.1.0 on my bitbucket download page. I haven&#39;t updated my binary package to 5.2.6 yet, which you can find on the official download page.</p><p>Links:</p><p>Allegro 5.2.5 and Allegro 4.4.3</p><p><a href="https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/src/master/">https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/src/master/</a></p><p><a href="https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/">https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/</a></p><p>Official binaries :</p><p><a href="https://github.com/liballeg/allegro5/releases">https://github.com/liballeg/allegro5/releases</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 14 Sep 2020 04:15:58 +0000</pubDate>
	</item>
</rss>
