<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Compile Errors</title>
		<link>http://www.allegro.cc/forums/view/515597</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 04 Aug 2005 02:53:04 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m trying to take a project from Dev-C++ to MSVC++ 6.0, and where it compiles fine in Dev I get:</p><div class="source-code snippet"><div class="inner"><pre>c:\program files\microsoft visual studio\vc98\include\wingdi.h<span class="k2">(</span><span class="n">486</span><span class="k2">)</span> <span class="k2">:</span> error C2371: <span class="s">'BITMAP'</span> <span class="k2">:</span> redefinition<span class="k2">;</span> different basic types
        c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h<span class="k2">(</span><span class="n">220</span><span class="k2">)</span> <span class="k2">:</span> see declaration of <span class="s">'BITMAP'</span>
c:\program files\microsoft visual studio\vc98\include\wingdi.h<span class="k2">(</span><span class="n">3429</span><span class="k2">)</span> <span class="k2">:</span> error C2229: <span class="k1">struct</span> <span class="s">'tagDIBSECTION'</span> has an illegal zero-sized array
</pre></div></div><p>

errors with MSVC. Anyone know what is going on?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 01:14:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What kind of project did you create when you started the MSVC project? It should be a &quot;Win32&quot; application and not &quot;Win32 Console Application&quot;, or something else. That&#39;s the only thing I can think of that might be pulling wingdi.h into your project for no good reason.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ultio)</author>
		<pubDate>Thu, 04 Aug 2005 01:17:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Include winalleg.h after allegro.h.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Thu, 04 Aug 2005 01:19:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I created 2 projects cause I thought that was it, but I get the same for both. Once in a project where do you check/change that?</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Include winalleg.h after allegro.h.
</p></div></div><p>

I don&#39;t include winalleg at all.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 01:19:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have no idea. I haven&#39;t used MSVC 6.0 in a long time. I&#39;d say start over and use RB&#39;s advice. I&#39;m assuming you&#39;re trying to use some Windows specific stuff in conjunction with Allegro, no?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ultio)</author>
		<pubDate>Thu, 04 Aug 2005 01:21:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I&#39;m assuming you&#39;re trying to use some Windows specific stuff in conjunction with Allegro, no?
</p></div></div><p>
Nope
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 01:21:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hmm. When you choose to make a new &quot;Win32&quot; project, are you ensuring the the project is &quot;empty&quot; when it&#39;s created? I think there&#39;s a checkbox to create empty projects. This is more important in MSVC7, but I might also be required in MSVC6.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ultio)</author>
		<pubDate>Thu, 04 Aug 2005 01:22:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hmm.. you created an empty project, or created one that includes a stdafx.h file? If so, begin again and create an empty one.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Thu, 04 Aug 2005 01:23:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Same error. Here is what I do:</p><p>1) Create empty Win32 Application, call stacked<br />2) Copy off my source files from Dev, and past them in the stacked directory created by MSVC (this includes a sub directory for tinyXML)<br />3) Project-&gt;Add To Project-&gt;Add Files, include all source files<br />4) Link in alld.lib<br />5) compile and getts errors
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 01:27:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are you sure you&#39;re not including some file that DevCPP created in order to work correctly? I don&#39;t know much about DevCPP and what it requires to work right. I&#39;m guessing that it wouldn&#39;t make any weirdo files that are going to include Windows specific stuff (when dealing with Allegro programs), but you never know.</p><p>Have you tried making a new project that has the barebones for ensuring that Allegro works in your MSVC studio?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ultio)</author>
		<pubDate>Thu, 04 Aug 2005 01:30:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It looks as if you are somehow including the windows header.  Probably in MSVC some of the standard headers do that.  Whatever file is giving you errors, put this at the top.</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#include &lt;allegro.h&gt;</span>
<span class="p">#include &lt;winalleg.h&gt;</span>
</pre></div></div><p>

That magic should fix the errors.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Wetimer)</author>
		<pubDate>Thu, 04 Aug 2005 01:30:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;re including something that includes windows.h. You need to include allegro and winalleg.h before whatever it is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Thu, 04 Aug 2005 01:34:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Have you tried making a new project that has the barebones for ensuring that Allegro works in your MSVC studio?
</p></div></div><p>

A small allegro app works.</p><p>I&#39;ve never had this problem before. </p><p>I&#39;ll try your fix Ewert but I still don&#39;t understand why it&#39;s doing this, when it works normally.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
You&#39;re including something that includes windows.h.
</p></div></div><p>

I&#39;m not doing anything out of the normal. Like I said it compiles with Dev
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 01:35:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I&#39;m not doing anything out of the normal. Like I said it compiles with Dev</p></div></div><p>
Doesn&#39;t mean much. MSVC is probably trying to pull in a Windows header from a &quot;standard&quot; header, which pulls in windows.h.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Thu, 04 Aug 2005 01:50:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah it&#39;s probably tinyXML doing it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 01:56:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Did you remember to select &quot;MULTITHREADED DLL&quot; for the runtime-lib on the &quot;code generation&quot; project-settings page?</p><div class="quote_container"><div class="title">Kitty Cat said:</div><div class="quote"><p>
Doesn&#39;t mean much. MSVC is probably trying to pull in a Windows header from a &quot;standard&quot; header, which pulls in windows.h.
</p></div></div><p>
On MSVC6 this is not the case, when you create an empty win32 app.<br />(Neither MFC nor any standard headers will be used then.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Thu, 04 Aug 2005 02:00:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK, it&#39;s tinyXML doing it. Ran a since int main() with allegro and it worked, and as soon as I included tinyxml.h I get that error. So what should I do with tinyXML to get around this, while still keeping cross-platform code?</p><p>[edit]<br />Here is it:</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#if defined( DEBUG ) &amp;&amp; defined( _MSC_VER )</span>
<span class="p">#include &lt;windows.h&gt;</span>
<span class="p">#define TIXML_LOG OutputDebugString</span>
<span class="p">#else</span>
<span class="p">#define TIXML_LOG printf</span>
<span class="p">#endif</span>
</pre></div></div><p>






[edit]<br />putting <br />#include &lt;allegro.h&gt;<br />#include &lt;winalleg.h&gt;<br />Works, but I don&#39;t want to keep putting this and commenting it out when I use it for allegro or non-allegro programs. How can I make this easier? Some kind of #define maybe?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 02:08:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Include &lt;winalleg.h&gt; instead of &lt;windows.h&gt; in tynixml.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Thu, 04 Aug 2005 02:18:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro.h probably defines ALLEGRO_H or something.  You could use #ifdefs to detect that and include winalleg.h if allergo.h has been included already.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Wetimer)</author>
		<pubDate>Thu, 04 Aug 2005 02:22:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="p">#include &lt;allegro.h&gt;</span>
<span class="p">#ifdef ALLEGRO_WINDOWS</span>
<span class="p">#include &lt;winalleg.h&gt; // tinyXML hack</span>
<span class="p">#endif</span>
<span class="p">#include &lt;tinyxml.h&gt;</span>
...
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Thu, 04 Aug 2005 02:25:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Include &lt;winalleg.h&gt; instead of &lt;windows.h&gt; in tynixml.
</p></div></div><p>

That doesn&#39;t help if I&#39;m not creating a non allegro program does it? Anyway I just did:</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#if defined( DEBUG ) &amp;&amp; defined( _MSC_VER )</span>
<span class="p">#include &lt;allegro.h&gt;</span>
<span class="p">#include &lt;winalleg.h&gt;</span>
<span class="p">#include &lt;windows.h&gt;</span>
<span class="p">#define TIXML_LOG OutputDebugString</span>
<span class="p">#else</span>
<span class="p">#define TIXML_LOG printf</span>
<span class="p">#endif</span>
</pre></div></div><p>

and it work. Thanks all.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 02:26:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>tinyXML works fine with VC6.</p><p>Here is my main header file:
</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#include &lt;string&gt;</span>
<span class="p">#include &lt;map&gt;</span>
<span class="p">#include &lt;vector&gt;</span>
<span class="p">#include &lt;sstream&gt;</span>
<span class="p">#include &lt;stdio.h&gt;</span>
<span class="p">#include &lt;time.h&gt;</span>
<span class="p">#include &lt;math.h&gt;</span>
<span class="p">#include &lt;allegro.h&gt;</span>
<span class="p">#ifdef _WIN32</span>
  <span class="p">#include &lt;winalleg.h&gt; //allow tinyXML to include windows.h</span>
<span class="p">#endif</span>
<span class="p">#include "extern/tinyxml_minimum/tinyxml.h"</span>
</pre></div></div><p>

Is this what you are doing as you have to have the winalleg.h entry.</p><p>Neil.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 04 Aug 2005 02:26:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
tinyXML works fine with VC6.
</p></div></div><p>

I know, it when you use tinyXML, VC6, and allegro together when you get the problem. It won&#39;t compile as is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 02:28:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Observe the #include&lt;allegro.h&gt; entry, that is why I&#39;m posting here as I use allegro and tinyxml and vc6 <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Are you including allegro, then winalleg then tinyxml, in that order?</p><p>Neil.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 04 Aug 2005 02:32:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
#ifdef _WIN32<br />    #include &lt;winalleg.h&gt; //allow tinyXML to include windows.h<br />#endif
</p></div></div><p>

I understand that, but you said:<br />&lt;code&gt;<br />tinyXML works fine with VC6.<br />&lt;code&gt;<br />I agree, but I am just saying that tinyxml doesn&#39;t compile out of the box sort of speak with allegro and msvc. You need to do the extra &quot;winalleg.h&quot; which I was unaware of. You don&#39;t need to do this with DEV-C++. So instead of putting the #ifdef in my code, I put it in tinyxml.h, where it&#39;s easier. I&#39;ll switch between compilers and that would always be a gotcha I would never remember. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 02:39:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The reason for the error is that the tinyXML header has the following line:<br />#include &lt;windows.h&gt;</p><p>It doesn&#39;t actually do anything. I talked to the tinyXML author about this and he just put it in for the sake of putting it in. The reason why it works in Dev-CPP is because DevCPP does not define a Microsoft windows constant <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>You can safely remove this line from tinyXML and all will work.</p><p>Neil.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 04 Aug 2005 02:45:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre>It doesn<span class="s">'t actually do anything. I talked to the tinyXML author about this and he just put it in for the sake of putting it in.</span>
</pre></div></div><p>

Weird. Got it working. Thanks all. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rick)</author>
		<pubDate>Thu, 04 Aug 2005 02:53:04 +0000</pubDate>
	</item>
</rss>
