Void function is causing compiler error "variable or field ‘funcName’ declared void"
<p>I have declared a helper function to a method of a class I declared in a header file, and for some reason when I compile the source code file I get an error telling me that I declared a variable or field as void.  I am not sure how to interpret this since my goal was for the function to be declared void.  </p>

<p>The compiler errors are as follows:</p>

<pre><code>k-d.cpp:10: error: variable or field ‘insert_Helper’ declared void
k-d.cpp:10: error: ‘node’ was not declared in this scope
k-d.cpp:10: error: ‘root’ was not declared in this scope
k-d.cpp:10: error: expected primary-expression before ‘*’ token
k-d.cpp:10: error: ‘o’ was not declared in this scope
k-d.cpp:10: error: expected primary-expression before ‘int’
</code></pre>

<p>The equivalent of line 10 in the code below is line 5.</p>

<p>The Source Code is as follows:</p>

<pre><code>#include &lt;iostream&gt;
#include "k-d.h" //Defines the node and spot structs
using namespace std;

void insert_Helper(node *root, spot *o, int disc) {
    (...Some code here...)
}

void kdTree::insert(spot *o) {  //kdTree is a class outlined in k-d.h
    insert_Helper(root, o, 0); //root is defined in k-d.h
}
</code></pre>

<p>If anybody can spot anything that would cause the compiler to not see this as a function it would be greatly appreciated.  Thanks!</p>

<p>P.S. I didn't tag this as a kdtree post because I'm pretty sure the solution does not depend on that aspect of the code.</p>

<p>Update:</p>

<p>Here is k-d.h:</p>

<pre><code>#ifndef K_D_H
#define K_D_H 

// Get a definition for NULL
#include &lt;iostream&gt;
#include &lt;string&gt;
#include "p2.h"
#include "dlist.h"

class kdTree {
    // OVERVIEW: contains a k-d tree of Objects

 public:

    // Operational methods

    bool isEmpty();
    // EFFECTS: returns true if tree is empy, false otherwise

    void insert(spot *o);
    // MODIFIES this
    // EFFECTS inserts o in the tree

    Dlist&lt;spot&gt; rangeFind(float xMax, float yMax);

    spot nearNeighbor(float X, float Y, string category);

    // Maintenance methods
    kdTree();                                   // ctor
    ~kdTree();                                  // dtor

 private:
    // A private type
    struct node {
        node *left;
        node *right;
        spot *o;
    };

    node   *root; // The pointer to the 1st node (NULL if none)
};

#endif 
</code></pre>

<p>And p2.h:</p>

<pre><code>#ifndef P2_H
#define P2_H
#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

enum  {
    xCoor = 0,
    yCoor = 1
};

struct spot {
    float key[2];
    string name, category;
};

#endif 
</code></pre>
