<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>allegro and fstream errors</title>
		<link>http://www.allegro.cc/forums/view/586045</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 23 Jun 2006 22:44:39 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>as the topic says if i include &lt;fstream&gt; and &lt;allegro.h&gt; i get a lot of errors.<br />so i searched the forums for a solution but even with the -D__GTHREAD_HIDE_WIN32API -flag i get errors like these:
</p><div class="source-code snippet"><div class="inner"><pre>cbot.cpp:26: error: use of <span class="s">'fixed'</span> is ambiguous
<span class="k3">/</span>usr<span class="k3">/</span>include<span class="k3">/</span>allegro<span class="k3">/</span>fixed.h:28: error:   first declared as <span class="s">'typedef int32_t fixed'</span> here
<span class="k3">/</span>usr<span class="k3">/</span>lib<span class="k3">/</span>gcc<span class="k3">/</span>i686-pc-linux-gnu<span class="k3">/</span><span class="n">4</span>.<span class="n">0</span>.<span class="n">3</span><span class="k3">/</span>..<span class="k3">/</span>..<span class="k3">/</span>..<span class="k3">/</span>..<span class="k3">/</span>include<span class="k3">/</span>c<span class="k3">+</span><span class="k3">+</span><span class="k3">/</span><span class="n">4</span>.<span class="n">0</span>.<span class="n">3</span><span class="k3">/</span>bits<span class="k3">/</span>ios_base.h:951: error:   also declared as <span class="s">'std::ios_base&amp; std::fixed(std::ios_base&amp;)'</span> here
...
</pre></div></div><p>
what to do now?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frank Drebin)</author>
		<pubDate>Fri, 23 Jun 2006 01:41:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Show us the line with the error.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 23 Jun 2006 01:44:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>cbot.cpp:26
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/fixed" target="_blank"><span class="a">fixed</span></a> distance<span class="k3">=</span><a href="http://www.allegro.cc/manual/itofix" target="_blank"><span class="a">itofix</span></a><span class="k2">(</span><span class="n">1000</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
seems to be some conflict with the fixed format.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frank Drebin)</author>
		<pubDate>Fri, 23 Jun 2006 01:53:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Do you happen to have a <tt>using namespace</tt> in your headers?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 23 Jun 2006 03:05:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, do NOT do using namespace std if you are going to be using fixed.  (Since std::fixed is a stream manipulator, you will end up with (std::)fixed and fixed in your namespace).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Carrus85)</author>
		<pubDate>Fri, 23 Jun 2006 03:23:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="k2">:</span><span class="k2">:</span><a href="http://www.allegro.cc/manual/fixed" target="_blank"><span class="a">fixed</span></a> distance<span class="k3">=</span><a href="http://www.allegro.cc/manual/itofix" target="_blank"><span class="a">itofix</span></a><span class="k2">(</span><span class="n">1000</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Indeterminatus)</author>
		<pubDate>Fri, 23 Jun 2006 04:04:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Do you happen to have a using namespace in your headers?
</p></div></div><p>
No!</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
::fixed distance=itofix(1000);
</p></div></div><p>
this works but is this really the only way?<br />and what does this exactly - in all my source files where i use the std-code there is a &quot;using namespace std&quot; ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frank Drebin)</author>
		<pubDate>Fri, 23 Jun 2006 11:28:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It tells the compiler to use the version of fixed not in any namespace--the one on the global scope.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 23 Jun 2006 15:57:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>so there isn&#39;t an workaround for this?<br />i can&#39;t imagine that i&#39;m the only one who got this problem...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frank Drebin)</author>
		<pubDate>Fri, 23 Jun 2006 16:19:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Nobody uses fixeds <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>And the workaround is not to use <tt>using namespace std;</tt>. This is the reason namespaces exist.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 23 Jun 2006 17:40:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>you mean to use the :: (scope-operator), heh?<br />there is no such thing like a namespace allegro, right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frank Drebin)</author>
		<pubDate>Fri, 23 Jun 2006 22:12:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
there is no such thing like a namespace allegro, right?
</p></div></div><p>

Right.</p><p>And as for the workaround: If you don&#39;t want to use <tt>::</tt>, and you also don&#39;t want to write <tt>std::</tt> everywhere, instead of <tt>using namespace std;</tt> you can put <tt>using std::vector;</tt> for example (of course, you&#39;d have to do that for everything you&#39;re using from the <tt>std</tt> namespace).</p><p>As long as you don&#39;t write <tt>using std::fixed;</tt> then, <tt>fixed</tt> isn&#39;t ambiguous, hence you won&#39;t need to explicitly identify which one you want.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Indeterminatus)</author>
		<pubDate>Fri, 23 Jun 2006 22:21:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ok thanks<br />or i&#39;ll change my fixed to float...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Frank Drebin)</author>
		<pubDate>Fri, 23 Jun 2006 22:44:39 +0000</pubDate>
	</item>
</rss>
