variable or field `generateMonster' declared void
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/364209/variable-or-field-declared-void">variable or field declared void</a>  </p>
</blockquote>



<p>I am working on a project getting some issues with a function.  I keep getting a error which I know means that I never declared a type, but I know I am.  All files have .h and .cpp included, so I don't have any missing includes.</p>

<p>this is the function I call it with - the issue is the generateMonster</p>

<pre><code>int room1(charType&amp; heroObj) {

    int r;
    roomType RoomObj;
    RoomObj.generateMonster(heroObj);

    cout &lt;&lt; "There's a hiss as you open this door, and you smell a sour odor, like something rotten or fermented. Inside you see a small room lined with dusty shelves, crates, and barrels. It looks like someone once used this place as a larder, but it has been a long time since anyone came to retrieve food from it." &lt;&lt; endl;
    cout &lt;&lt; endl &lt;&lt; "Room #1:\n 1. Door in the East corner of the North wall.\n 2. Door in the middle of the East wall.\n 3. Door in the east corner of the south wall.\n 4. Door in the West corner of the South wall.\n" &lt;&lt; endl;
    doIt();
    cin &gt;&gt; r;
    if (!cin.good())
       cout &lt;&lt; "That is not a valid option.  Please try again.";
       cin.clear();
       cin.ignore(100, '\n');

    system("cls");

    switch(r) {
              case 1:
                   genDoor();
                   hallway1(heroObj);
                   break;
              case 2:
                   genDoor();
                   hallway4(heroObj);
                   break;
              case 3:
                   genDoor();
                   hallway3(heroObj);
                   break;
              case 4:
                   genDoor();
                   hallway2(heroObj);
                   break;
    }

}
</code></pre>

<p>my prototype</p>

<pre><code>class roomType
    {
    public:
     roomType();
     void generateMonster(charType&amp; heroObj);
     void generateTreasure();

    private:
     int gold;
     int potion;
     int keys;
    };
</code></pre>

<p>and my function as a whole - <a href="http://pastie.org/4799752" rel="nofollow">http://pastie.org/4799752</a></p>
