'does not name a type' error in C++
<p>I have the following header file:</p>

<pre><code>#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stddef.h&gt; 
#include &lt;GL/glew.h&gt;
#include &lt;GL/glfw.h&gt;
#include &lt;glm/glm.hpp&gt;
#include &lt;glm/gtc/matrix_transform.hpp&gt;
#include &lt;glm/gtc/type_ptr.hpp&gt;
#include &lt;stdlib.h&gt;
#include &lt;vector&gt;

class Sphere
{   
    public:
        Sphere();
        int count_sphere_vertices(int ,int, int);
        Vertex* create_sphere(int ,int , int);
};
</code></pre>

<p>now when I compile my code I get this:</p>

<pre><code>Sphere.h:18:3: error: ‘Vertex’ does not name a type
Sphere.cpp:48:1: error: ‘Vertex’ does not name a type
</code></pre>

<p>and</p>

<pre><code>test_1.cpp: In function ‘int main()’: 
test_1.cpp:318:38: error: ‘class Sphere’ has no member named ‘create_sphere’
</code></pre>

<p>What does the </p>

<blockquote>
  <p>‘Vertex’ does not name a type</p>
</blockquote>

<p>means? And why do I get </p>

<blockquote>
  <p>‘class Sphere’ has no member named ‘create_sphere’</p>
</blockquote>

<p>since I have this in my Sphere.cpp:</p>

<pre><code>//Calculating points for the sphere (the algorithm is implemented here)
Vertex* Sphere::create_sphere(int dtheta,int dphi, int no_vertices)
{

    GLdouble x,y,z,x2,y2,z2;
    GLdouble magnitude=0;
    int n=-1;
    int theta,phi;
    const double PI = 3.1415926535897;
    GLdouble DTOR = (PI/180);//degrees to radians
    Vertex* sphere_vertices = new Vertex[no_vertices];


   for (theta=-90;theta&lt;=90-dtheta;theta+=dtheta) {
      for (phi=0;phi&lt;=360-dphi;phi+=dphi) {

    //calculating Vertex 1
     x = cos(theta*DTOR) * cos(phi*DTOR);
     y = cos(theta*DTOR) * sin(phi*DTOR);
         z = sin(theta*DTOR);

    n+=1;
    sphere_vertices[n].position[0] = x;
    sphere_vertices[n].position[1] = y;
    sphere_vertices[n].position[2] = z;


    //calculating Vertex 2
      x = cos((theta+dtheta)*DTOR) * cos(phi*DTOR);
      y = cos((theta+dtheta)*DTOR) * sin(phi*DTOR);
      z = sin((theta+dtheta)*DTOR);

    n+=1;
    sphere_vertices[n].position[0] = x;
    sphere_vertices[n].position[1] = y;
    sphere_vertices[n].position[2] = z;

     //calculating Vertex 3
     x = cos((theta+dtheta)*DTOR) * cos((phi+dphi)*DTOR);
     y = cos((theta+dtheta)*DTOR) * sin((phi+dphi)*DTOR);
     z = sin((theta+dtheta)*DTOR);

    n+=1;
    sphere_vertices[n].position[0] = x;
    sphere_vertices[n].position[1] = y;
    sphere_vertices[n].position[2] = z;

     //adding Vertex_1 again to divide the Quad into 2 triangles so it can be later filled with triangles!!!    
     //adding Vertex 1 again!
     x = cos(theta*DTOR) * cos(phi*DTOR);
     y = cos(theta*DTOR) * sin(phi*DTOR);
         z = sin(theta*DTOR);

     n+=1;
     sphere_vertices[n].position[0] = x;
     sphere_vertices[n].position[1] = y;
     sphere_vertices[n].position[2] = z;

        if (theta &gt; -90 &amp;&amp; theta &lt; 90) {

            //calculating Vertex 4
            x = cos(theta*DTOR) * cos((phi+dphi)*DTOR);
            y = cos(theta*DTOR) * sin((phi+dphi)*DTOR);
            z = sin(theta*DTOR);

            n+=1;
            sphere_vertices[n].position[0] = x;
            sphere_vertices[n].position[1] = y;
            sphere_vertices[n].position[2] = z;

             }
        }
   }

   //Setting the color
    for(int i=0; i&lt;no_vertices; i+=1)
    {
        sphere_vertices[i].color[0] = 1;
        sphere_vertices[i].color[1] = 0;
        sphere_vertices[i].color[2] = 0;
    }
    printf("%d &gt;&gt; \n", n);

    return sphere_vertices;
}
</code></pre>

<p>Thansk</p>

<p>EDIT: 
This is included in my test_1.cpp where the "main" method lies.</p>

<pre><code>#include "Sphere.h"
#include "Terrain.h"

using namespace std;

//Vertex Structure
struct Vertex {

    GLdouble position[3];
    GLfloat color[3];
    GLfloat texture[2];
};
</code></pre>

<p>Then I create a Sphere like this </p>

<pre><code> sphere_vertices_final = planet_1-&gt;create_sphere(5,5,no_sphere_vertices);
</code></pre>

<p>How I am supposed to include Vertex in the Sphere.h file?</p>
