<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Problems compiling excustom.c</title>
		<link>http://www.allegro.cc/forums/view/588763</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 28 Nov 2006 11:40:34 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/DIALOG" target="_blank"><span class="a">DIALOG</span></a> the_dialog<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span>
<span class="k2">{</span>
   <span class="c">/* (dialog proc)     (x)   (y)   (w)   (h)   (fg)  (bg)  (key) (flags)  (d1)                    (d2)  (dp)           (dp2) (dp3) */</span>
   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_clear_proc" target="_blank"><span class="a">d_clear_proc</span></a>,      <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">255</span>,  <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,       <span class="n">0</span>,                      <span class="n">0</span>,    NULL,          NULL, NULL  <span class="k2">}</span>,
   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_edit_proc" target="_blank"><span class="a">d_edit_proc</span></a>,       <span class="n">32</span>,   <span class="n">32</span>,   <span class="n">256</span>,  <span class="n">8</span>,    <span class="n">255</span>,  <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,       <span class="k1">sizeof</span><span class="k2">(</span>the_string<span class="k2">)</span><span class="k3">-</span><span class="n">1</span>,   <span class="n">0</span>,    the_string,    NULL, NULL  <span class="k2">}</span>,
   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_check_proc" target="_blank"><span class="a">d_check_proc</span></a>,      <span class="n">32</span>,   <span class="n">64</span>,   <span class="n">89</span>,   <span class="n">13</span>,   <span class="n">255</span>,  <span class="n">0</span>,    <span class="s">'t'</span>,  <span class="n">0</span>,       <span class="n">0</span>,                      <span class="n">0</span>,    <span class="s">"&amp;Toggle Me"</span>,  NULL, NULL  <span class="k2">}</span>,
   <span class="k2">{</span> clock_proc,        <span class="n">192</span>,  <span class="n">64</span>,   <span class="n">64</span>,   <span class="n">64</span>,   <span class="n">255</span>,  <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,       <span class="n">0</span>,                      <span class="n">0</span>,    NULL,          NULL, NULL  <span class="k2">}</span>,
   <span class="k2">{</span> <a href="http://www.allegro.cc/manual/d_button_proc" target="_blank"><span class="a">d_button_proc</span></a>,     <span class="n">120</span>,  <span class="n">160</span>,  <span class="n">81</span>,   <span class="n">17</span>,   <span class="n">255</span>,  <span class="n">0</span>,    <span class="n">0</span>,    D_EXIT,  <span class="n">0</span>,                      <span class="n">0</span>,    <span class="s">"Exit"</span>,        NULL, NULL  <span class="k2">}</span>,
   <span class="k2">{</span> NULL,              <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,    <span class="n">0</span>,       <span class="n">0</span>,                      <span class="n">0</span>,    NULL,          NULL, NULL  <span class="k2">}</span>
<span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

I am trying to compile the excustom.c file provided by Allegro. But when I try to compile I always get the error message
</p><div class="source-code snippet"><div class="inner"><pre>initializer element is <span class="k1">not</span> a constant
<span class="k2">(</span>near initialization <span class="k1">for</span> <span class="s">'the_dialog[0].proc'</span><span class="k2">)</span>
</pre></div></div><p>
and so on down the list for each one of the proc&#39;s and the NULL<br />I am compiling the code as C code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Mon, 27 Nov 2006 12:51:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>what compiler are you using, and what parameters are you passing to it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 27 Nov 2006 13:56:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am using Dev-C++</p><p>no params
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Mon, 27 Nov 2006 14:04:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Start a command prompt and navigate to the examples directory, then enter the following:</p><p><tt>gcc excustom.c -o excustom.exe -lalleg</tt>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 27 Nov 2006 14:24:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>still says the same thing</p><p>initializer element is not a constant<br />(near initialization for &#39;the_dialog[0].proc&#39;)</p><p>all the way to the_dialog[5]
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Mon, 27 Nov 2006 14:36:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How is <tt>the_string</tt> defined?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Hrvoje Ban)</author>
		<pubDate>Mon, 27 Nov 2006 14:50:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><span class="k1">char</span> the_string<span class="k2">[</span><span class="n">32</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">"Change Me!"</span><span class="k2">;</span></span></p><p>is anyone else having problems compiling excustom.c?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Mon, 27 Nov 2006 15:00:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
is anyone else having problems compiling excustom.c?
</p></div></div><p>

It compiled perfectly from the command line for me, using the call to gcc that I gave in my previous post. </p><p>If there&#39;s still a problem, then it&#39;s either your gcc or allegro installation causing it. Did you install gcc (MinGW) directly, or get Dev-C++ to do it for you? Likewise for Allegro.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 27 Nov 2006 16:16:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>We&#39;ve had this topic before. I did a search and voila. C++ requires casting in certain places that C does not.</p><p><a href="http://www.allegro.cc/forums/thread/176811">http://www.allegro.cc/forums/thread/176811</a></p><p>Put a &#39;(void *)&#39; in front of the strings.</p><p>(void*)&quot;&amp;Toggle Me&quot;</p><p>Or tell DevC++ to compile it as a C file.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (DanielH)</author>
		<pubDate>Mon, 27 Nov 2006 17:51:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I guess the following line (from the orignal post) wasn&#39;t true then:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I am compiling the code as C code.
</p></div></div><p>

Edit: I just read the thread you linked to. That&#39;s an entirely different error.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 27 Nov 2006 17:55:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I am compiling the code in C.</p><p>Everything works fine except for the proc&#39;s (d_clear_proc, etc.)</p><p>Also, I guess Dev-C++ installed gcc for me. When I try to compile, i get errors from the d_xxxx_proc&#39;s</p><p>When I take them out, I dont get the error, it just doesnt work <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Tue, 28 Nov 2006 00:11:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I am compiling the code in C.
</p></div></div><p>

The command line call I told you to try will compile as C as well, which I should have taken into consideration in my previous post, but didn&#39;t.</p><p>The only other thing I can think of is manually installing MinGW and Allegro yourself instead of letting Dev-C++ do it, since that&#39;s the only difference between your setup and mine, and it works flawlessly for me. However, I&#39;m sure that with the number of people that use Dev-C++, someone else would have come across this problem before if it&#39;s the cause.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 28 Nov 2006 01:08:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>well i have narrowed it down to the d_xxxx_proc calls
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Tue, 28 Nov 2006 06:09:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
well i have narrowed it down to the d_xxxx_proc calls
</p></div></div><p>

Yes, but the same calls compile fine for me, so they&#39;re not the problem per se.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 28 Nov 2006 08:10:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Just a check, what does &#39;gcc -v&#39; say?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kazzmir)</author>
		<pubDate>Tue, 28 Nov 2006 08:17:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
kazzmir: Just a check, what does &#39;gcc -v&#39; say?
</p></div></div><p>

gcc version 3.2 (mingw special 20020817-1)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Tue, 28 Nov 2006 08:25:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
gcc version 3.2 (mingw special 20020817-1)
</p></div></div><p>

Yep, that&#39;s the version that gets installed by Dev-C++. The latest MinGW is gcc 3.4.2.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 28 Nov 2006 08:28:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>so i need gcc 3.4.2?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Tue, 28 Nov 2006 08:32:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
so i need gcc 3.4.2?
</p></div></div><p>

I don&#39;t know if that&#39;s the problem or not, but it certainly wouldn&#39;t hurt to update to a later version.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 28 Nov 2006 09:47:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>do you have the link by any chance? <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Tue, 28 Nov 2006 09:53:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The easiest way to get MinGW is to use the <a href="http://sourceforge.net/forum/forum.php?forum_id=586329">automated installer</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 28 Nov 2006 10:08:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>okay i now have gcc 3.4.2, maybe it is allegro. maybe i need to update</p><p>What version are you using to compile.. i have 4.0.0</p><p>I have downloaded 4.2.0, how do I set the MINGDIR environment variable under Windows XP? I&#39;m looking at the documentation, but i can&#39;t seem to figure it out
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Tue, 28 Nov 2006 10:11:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>From memory but.. Right click on &quot;my computer&quot; -&gt; properties -&gt; user profile or environment -&gt; edit the PATH in the top box or add MINGDIR
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kazzmir)</author>
		<pubDate>Tue, 28 Nov 2006 11:12:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Kazzmir was pretty close.</p><p>After right clicking and selecting &quot;properties&quot; on My Computer (or selecting &quot;System&quot; from the Control Panel), it goes: Advanced -&gt; Environment Variables. I always just add the &quot;d:\mingw\bin&quot; (your location may vary) directory to the path myself and don&#39;t bother with setting a MINGDIR variable.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 28 Nov 2006 11:34:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for all of your help! I think I have figured this buggy question out!! I don&#39;t think the version of my gcc was the problem (although i did upgrade).. I was running alleg40.dll and changed to alleg42.dll, and now the dialog programs compile no problem!!</p><p>Thanks again!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Tue, 28 Nov 2006 11:38:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Glad to hear the matter is resolved. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 28 Nov 2006 11:40:34 +0000</pubDate>
	</item>
</rss>
