<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>http://forums.xna.com/forums/50.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/190229.aspx</link><pubDate>Mon, 15 Jun 2009 16:46:03 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190229</guid><dc:creator>zanders</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/190229.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=190229</wfw:commentRss><description>Nice advice.. I&amp;#39;ve bought the Effective C++ book off amazon, so hopefully that will help me improve things!</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/190220.aspx</link><pubDate>Mon, 15 Jun 2009 16:19:45 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190220</guid><dc:creator>Steve Roe</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/190220.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=190220</wfw:commentRss><description>Scott Meyer&amp;#39;s &amp;quot;Effective C++&amp;quot; series&lt;br /&gt;
&lt;br /&gt;
   Effective C++&lt;br /&gt;
   More Effective C++&lt;br /&gt;
   Effective STL&lt;br /&gt;
&lt;br /&gt;
and Herb Sutters &amp;quot;Exceptional C++&amp;quot; series&lt;br /&gt;
&lt;br /&gt;
   Exceptional C++&lt;br /&gt;
   More Exceptional C++&lt;br /&gt;
   Exceptional C++ Style&lt;br /&gt;
&lt;br /&gt;
have tons of good advice on C++ best practices.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;d start with the Scott Meyers books first.&lt;br /&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/190152.aspx</link><pubDate>Mon, 15 Jun 2009 13:03:24 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190152</guid><dc:creator>zanders</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/190152.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=190152</wfw:commentRss><description>I&amp;#39;m currently at uni but my comp. sci course mainly focuses on Java programming, but they did do a few lectures on C++. I can code in Java and C# very well, and C++ has very similar syntax, so I agree that this is just an experience thing.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am using the Microsoft C++ Compiler that comes with Visual Studio 2008 which I&amp;#39;m pretty sure supports the #pragma once directive. Oh well, I&amp;#39;ll be making a lot more use of forward declarations in header files since you don&amp;#39;t need to worry about the internals of the class!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;How do precompiled headers work?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this case I&amp;#39;m not using namespaces since this is the main program. The game library I&amp;#39;m using makes use of namespaces though. Do you recommend using namespaces all of the time, including your main program code?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This advice is great, thanks! :D Do you have any more advice on good practice in C++?&lt;/div&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/189974.aspx</link><pubDate>Sun, 14 Jun 2009 19:15:01 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:189974</guid><dc:creator>Eclipse Games</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/189974.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=189974</wfw:commentRss><description>Oh, BTW, if you&amp;#39;re using already namespaces, check you haven&amp;#39;t forgotten to close any of them because that may cause that very same error of unexpected identifier... It&amp;#39;s a really nasty mistake since the compiler won&amp;#39;t give you much info on the subject, but since you are already in a namespace, classes from other namespaces are not accessible as normally.&lt;br /&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/189973.aspx</link><pubDate>Sun, 14 Jun 2009 19:13:02 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:189973</guid><dc:creator>Eclipse Games</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/189973.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=189973</wfw:commentRss><description>To be honest I learnt C++ at the uni and I&amp;#39;ve improved a lot since by reading articles on the internet, discussing with people, etc... I think that code reviews, discussing your code, etc., helps a lot, so maybe what you need is just that, a bit of experience.&lt;br /&gt;
&lt;br /&gt;
Regarding the #pragma once, I&amp;#39;d have thought the same, but I&amp;#39;d recommend you always use both the #pragma and the #ifndef ... #define ... at the beginning of the file. Not all the compilers support the #pragma once directive. Anyway, Microsoft compiler usually supports that directive so I don&amp;#39;t know...&lt;br /&gt;
&lt;br /&gt;
Anyway, I hope the forward declaration solves it for you. It will also save you loads of compilation time if you use it properly: you should really avoid #includes in .h files unless they are completely necessary. That and a good use of precompiled headers speed up incredibly the compilation times.&lt;br /&gt;
&lt;br /&gt;
Finally, just an advise if you mind me. Use namespaces, they help a lot when organizing the code properly. It&amp;#39;s really simple but it helps you divide your classes better. Maybe you are already using them and just avoiding them in these files because they are the main program or something, but just in case.&lt;br /&gt;
&lt;br /&gt;
Happy coding!&lt;br /&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/189554.aspx</link><pubDate>Sat, 13 Jun 2009 12:04:56 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:189554</guid><dc:creator>zanders</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/189554.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=189554</wfw:commentRss><description>I have a few books on C++ programming; Accelerated C++ and a Deitel C++ How To Program. Their examples and explanations are very nice right up until you got horribly stuck on problems like this!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;ll know to use forward declarations for next time though. I did wonder if an include loop was causing the problem, but i&amp;#39;m using the #pragma once declaration at the top of each header file... I thought that it stops include loops from occurring.&lt;/div&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/189354.aspx</link><pubDate>Fri, 12 Jun 2009 19:59:51 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:189354</guid><dc:creator>Eclipse Games</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/189354.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=189354</wfw:commentRss><description>Oh, I forgot to tell you. If you forward declare the class you don&amp;#39;t need to include it in Grid.h&lt;br /&gt;
&lt;br /&gt;
You should really look for some good books on C++ programming. I&amp;#39;m sorry I can&amp;#39;t recommend you one now, but there are lots out there.&lt;br /&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/189352.aspx</link><pubDate>Fri, 12 Jun 2009 19:58:14 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:189352</guid><dc:creator>Eclipse Games</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/189352.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=189352</wfw:commentRss><description>You have a problem of include loops maybe?&lt;br /&gt;
&lt;br /&gt;
if you&amp;#39;re just using Pea as a pointer why don&amp;#39;t you try to forward declare it and then in the .cpp use it properly. It&amp;#39;s the &amp;quot;elegant&amp;quot; and actually efficient (in compiling time) way to do it:&lt;br /&gt;
&lt;br /&gt;
Grid.h:&lt;br /&gt;
....&lt;br /&gt;
class Pea;&lt;br /&gt;
&lt;br /&gt;
class Grid&lt;br /&gt;
{&lt;br /&gt;
...&lt;br /&gt;
std::vector&amp;lt;Pea*&amp;gt; m_Peas;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Grid.cpp&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
#include &amp;quot;Pea.h&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
// do something with my vector of peas&lt;br /&gt;
m_Peas.push_back(new Pea());&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/188971.aspx</link><pubDate>Thu, 11 Jun 2009 23:52:36 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:188971</guid><dc:creator>zanders</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/188971.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=188971</wfw:commentRss><description>I have defined it to be like that so that std::vector&amp;lt;Pea *&amp;gt; holds pointers to the pea objects, which are on the heap. :S&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The compiler lets me define std::vector&amp;lt;Pea *&amp;gt; elsewhere in my code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I tried changing it to std::vector&amp;lt;Pea&amp;gt;* but the compiler still complains about Pea being undeclared. :(&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;hr /&gt;&lt;/span&gt;Edit:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I fixed it! I removed the #include &amp;lt;Pea.h&amp;gt; and wrote class Pea; instead. The compiler stops complaining!&lt;/div&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/188913.aspx</link><pubDate>Thu, 11 Jun 2009 22:11:30 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:188913</guid><dc:creator>TordinBjorn</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/188913.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=188913</wfw:commentRss><description>are you sure its not definde like this&lt;div&gt;&amp;lt;Pea&amp;gt;*peas ?&lt;/div&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/188900.aspx</link><pubDate>Thu, 11 Jun 2009 22:02:07 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:188900</guid><dc:creator>zanders</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/188900.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=188900</wfw:commentRss><description>I&amp;#39;ve not missed the closing &amp;quot;};&amp;quot; part. :( here is the full Grid.h definition...&lt;div&gt;&lt;span&gt;&lt;div style="overflow-x:auto;overflow-y:auto;background-color:white;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;font-family:&amp;#39;courier new&amp;#39;;font-size:11px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="width:99%;margin-top:2px;margin-right:0px;margin-bottom:2px;margin-left:0px;border-collapse:collapse;border-bottom-style:solid;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;"&gt;                &lt;tr&gt;            &lt;td&gt;&lt;span style="font-size:11px;"&gt;&lt;/span&gt;&lt;span style="color:gray;"&gt;#pragma once&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;&lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;lt;vector&amp;gt;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;BoyLib/Vector2.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Boy/Graphics.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Boy/ResourceManager.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Box2D.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Pea.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;enum&lt;/span&gt;&lt;span style="font-size:11px;"&gt; TileType &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;{ &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    None = 0, &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Normal = 1, &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    LeftRamp = 2, &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    RightRamp = 3, &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Gel = 4, &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Spring = 5, &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Flag = 6 &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;}; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;struct&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Tile &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;{ &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    TileType type; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    BoyLib::Vector2 position; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    b2Body *body; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;}; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:green;"&gt;//The grid class draws the tileset grid.&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;class&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Grid &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;{ &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;span style="font-size:11px;"&gt;: &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Grid(Boy::ResourceManager *rm, b2World *world, std::vector&amp;lt;Pea *&amp;gt; peas); &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    ~Grid(); &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; draw(Boy::Graphics *g); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; setTileType(TileType type, &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; x, &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; y); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    TileType getTileType(&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; x, &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; y); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Tile getTile(&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; x, &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; y); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; toWorld(BoyLib::Vector2 *point); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; toGrid(BoyLib::Vector2 *point); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;const&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;static&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; mWidth = 15; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;const&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;static&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; mHeight = 11; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;float&lt;/span&gt;&lt;span style="font-size:11px;"&gt; mCellWidth; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;float&lt;/span&gt;&lt;span style="font-size:11px;"&gt; mCellHeight; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt;&lt;span style="font-size:11px;"&gt;: &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; ensureRange(&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; *x, &lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt; *y); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Tile mTiles[mWidth][mHeight]; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Boy::Image *mImages[7]; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Boy::Image *mImageShadow; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    std::vector&amp;lt;Pea*&amp;gt; mPeas; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    b2World *mWorld; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;}; &lt;/td&gt;        &lt;/tr&gt;    &lt;/table&gt;&lt;/div&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;Also i get the following errors when i try to compile...&lt;/div&gt;&lt;div&gt;&lt;div&gt;error C2065: &amp;#39;Pea&amp;#39; : undeclared identifier&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;at line 32&lt;/div&gt;&lt;div&gt;&lt;div&gt;error C2059: syntax error : &amp;#39;&amp;gt;&amp;#39;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt; at line 32&lt;/div&gt;&lt;div&gt;&lt;div&gt;error C2059: syntax error : &amp;#39;)&amp;#39;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt; at line 32&lt;/div&gt;&lt;div&gt;&lt;div&gt;error C2143: syntax error : missing &amp;#39;;&amp;#39; before &amp;#39;}&amp;#39; at line 32&lt;/div&gt;&lt;div&gt;&lt;div&gt;fatal error C1004: unexpected end-of-file found&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;at line 32&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the problem seems to be caused by this line, but I can&amp;#39;t see anything wrong with it or the definition :S&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;;font-size:11px;border-collapse:collapse;line-height:11px;"&gt;Grid(Boy::ResourceManager *rm, b2World *world, std::vector&amp;lt;Pea *&amp;gt; peas);&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It works if i remove the std::vector&amp;lt;Pea *&amp;gt; part of the constructor. But I need that bit for my game to work :P&lt;/div&gt;&lt;div&gt;Thanks for the help... C++ is so weird.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description></item><item><title>Re: C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/188628.aspx</link><pubDate>Thu, 11 Jun 2009 15:35:15 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:188628</guid><dc:creator>TordinBjorn</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/188628.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=188628</wfw:commentRss><description>where dose the error point at? so we can start somewhere.&lt;br /&gt;
but the only thing i can see is this&lt;br /&gt;
&lt;br /&gt;
class Grid&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span&gt;Grid(Boy::ResourceManager&amp;nbsp;*rm,&amp;nbsp;b2World&amp;nbsp;*world,&amp;nbsp;std::vector&amp;lt;Pea&amp;nbsp;*&amp;gt;&amp;nbsp;peas); &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;span&gt;&amp;nbsp;~Grid(); &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt;&amp;nbsp;draw(Boy::Graphics&amp;nbsp;*g);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
}; &amp;lt;-------------------- You missed this.&lt;br /&gt;
but i suspect thats a copy to the forum error.&lt;br /&gt;</description></item><item><title>C++ Undeclared Identifier!</title><link>http://forums.xna.com/forums/thread/188366.aspx</link><pubDate>Wed, 10 Jun 2009 23:36:22 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:188366</guid><dc:creator>zanders</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/188366.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=188366</wfw:commentRss><description>Hello! I&amp;#39;m learning C++, and I&amp;#39;m trying to make a game in DirectX, so I hope this is the right forum!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;ve created an absolutely horrible compiler error (a set of errors) that just don&amp;#39;t make sense, so I need some help!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are some of the errors:&lt;/div&gt;&lt;div&gt;&lt;div&gt;error C2065: &amp;#39;Pea&amp;#39; : undeclared identifier&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;34&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;peas&lt;/div&gt;&lt;div&gt;&lt;div&gt;error C2059: syntax error : &amp;#39;&amp;gt;&amp;#39;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt; 34&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;peas&lt;/div&gt;&lt;div&gt;&lt;div&gt;fatal error C1004: unexpected end-of-file found&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;34&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;peas&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and it repeats those same errors 3 times.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, here is the offending code..&lt;/div&gt;&lt;div&gt;This is grid.h...&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;div style="overflow-x:auto;overflow-y:auto;background-color:white;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;font-family:&amp;#39;courier new&amp;#39;;font-size:11px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="width:99%;margin-top:2px;margin-right:0px;margin-bottom:2px;margin-left:0px;border-collapse:collapse;border-bottom-style:solid;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;"&gt;                &lt;tr&gt;            &lt;td&gt;&lt;span style="font-size:11px;"&gt;&lt;/span&gt;&lt;span style="color:gray;"&gt;#pragma once&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;&lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;lt;vector&amp;gt;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;BoyLib/Vector2.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Boy/Graphics.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Boy/ResourceManager.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Box2D.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Pea.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span&gt;[snip]&lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:green;"&gt;//The grid class draws the tileset grid.&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;class&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Grid &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;{ &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;span style="font-size:11px;"&gt;: &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Grid(Boy::ResourceManager *rm, b2World *world, std::vector&amp;lt;Pea *&amp;gt; peas); &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    ~Grid(); &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; draw(Boy::Graphics *g); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;[snip] &lt;/td&gt;        &lt;/tr&gt;    &lt;/table&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;and this is Pea.h...&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;div style="overflow-x:auto;overflow-y:auto;background-color:white;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;font-family:&amp;#39;courier new&amp;#39;;font-size:11px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="width:99%;margin-top:2px;margin-right:0px;margin-bottom:2px;margin-left:0px;border-collapse:collapse;border-bottom-style:solid;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;"&gt;                &lt;tr&gt;            &lt;td&gt;&lt;span style="font-size:11px;"&gt;&lt;/span&gt;&lt;span style="color:gray;"&gt;#pragma once&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#ifndef PEA_H&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#define PEA_H&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;&lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Boy/ResourceManager.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;BoyLib/Vector2.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Boy/Graphics.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Grid.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#include &amp;quot;Box2D.h&amp;quot;&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#define GRAVITY 5.0f&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;[snip] &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:green;"&gt;//controls pea physics and movement, along with AI.&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;class&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Pea &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;{ &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt;&lt;span style="font-size:11px;"&gt;: &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    Pea(BoyLib::Vector2 position, b2World *world); &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    ~Pea(); &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; update(&lt;/span&gt;&lt;span style="color:blue;"&gt;float&lt;/span&gt;&lt;span style="font-size:11px;"&gt; dt); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    b2Vec2 getPosition() &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    { &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;        &lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;span style="font-size:11px;"&gt; mPosition; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    } &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    &lt;span style="color:blue;"&gt;void&lt;/span&gt;&lt;span style="font-size:11px;"&gt; setPeaState(PeaState state); &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    PeaState getPeaState() &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    { &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;        &lt;span style="color:blue;"&gt;return&lt;/span&gt;&lt;span style="font-size:11px;"&gt; mState; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    } &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt;&lt;span style="font-size:11px;"&gt;: &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    PeaState mState; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    b2Vec2 mPosition; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    b2Body *mBody; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;    b2World *mWorld; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;}; &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;            &lt;td&gt;&lt;span style="color:gray;"&gt;#endif&lt;/span&gt;&lt;span style="font-size:11px;"&gt; &lt;/span&gt;&lt;/td&gt;        &lt;/tr&gt;    &lt;/table&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Any ideas? I&amp;#39;m utterly stumped why it won&amp;#39;t read Pea.h and find the definition.&lt;/div&gt;</description></item></channel></rss>