"prototype does not match any class" error when separating into .h and .cpp files : <p>Writing a program for a game of "Mastermind". In one of my classes, code, I have seperated it into .h and .cpp files and I'm not sure why my cpp file keeps giving me this error when compiling: Error: prototype for 'int code :: getVector()' does not match any class in 'code'</p>

<p>To my knowledge I have the correct header for getVector() in my code.h file:</p>

<pre><code>#include &lt;vector&gt;
#include &lt;iostream&gt;

#ifndef CODE_H
#define CODE_H

using namespace std;

class code      //strores code vector and checks for correct and incorrect numbers
{
private:

    vector&lt;int&gt; codeVector {0,0,0,0};       //vector storing code (guess and secret code depending on object)

public:

    vector&lt;int&gt; getVector();        //retrievs private codeVector

    void setCodeVectorToGuess(vector&lt;int&gt; guess);   //sets private codeVector to vector passed in

    void setCodeVectorToSecretCode();   //uses rand function to set random secret code vector

    int checkCorrect(code guessObject);     //uses for loop to check what values are correct number correct location by checking equivalence at each vector index

    int checkIncorrect(code guessObject);   //checks numbers between the two vectors using two for loops which each replace values in the vectors with non-equivalent out-of-range numbers

};

#endif // CODE_H
</code></pre>

<p>and the right syntax in my .cpp file:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt; 
#include &lt;time.h&gt;

#include "code.h"

using namespace std;



//code :: codeVector = {0,0,0,0};

code :: getVector()     //retrieves private codeVector
{
    return codeVector;
}

code :: setCodeVectorToGuess(vector&lt;int&gt; guess) //sets private codeVector to vector passed in
{
    codeVector = guess;
}

code :: setCodeVectorToSecretCode() //uses rand function to set random secret code vector
{
    srand (time(NULL));
    codeVector = {rand() % 5 + 1, rand() % 5 + 1, rand() % 5 + 1, rand() % 5 + 1};
}

code :: checkCorrect(code guessObject)      //uses simple for loop to check what values are correct number correct location
{
    int correctPlaceCorrectNum = 0;

    vector&lt;int&gt; guessVector;
    guessVector = guessObject.getVector();

    for (int o=0; o&lt;codeVector.size(); o++)
    {
        if (codeVector[o] == guessVector[o])
        {
            correctPlaceCorrectNum ++;
        }
    }

    return correctPlaceCorrectNum;
}

code :: checkIncorrect(code guessObject)    //checks numbers between the two vectors using two for loops which each replace values in the vectors with non-equivalent out-of-range numbers
{
    int incorrectPlaceCorrectNum = 0;
    int counter(0), counter2(0);

    int array1[8] = {6,7,8,9};          //two arrays used for the elimination of vector values by substitution of non-equivalent values
    int array2[8] = {10,11,12,13};      //

    vector&lt;int&gt; secretCodeVector {0,0,0,0};     //copy of secret code vector
    secretCodeVector = getVector();

    vector&lt;int&gt; guessVector {0,0,0,0};          //copy of guess vector
    guessVector = guessObject.getVector();

    for (int u=0; u&lt;secretCodeVector.size(); u++)       //checks and replaces all correct number correct location values in secret code vector
    {
        if (secretCodeVector[u] == guessVector[u])
        {

            secretCodeVector[u] = array1[counter];

            counter++;

        }
    }

    for (int i=0; i&lt;secretCodeVector.size(); i++)       //checks and replaces all correct number incorrect location values in both vectors
    {

        for (int l=0; l&lt;secretCodeVector.size(); l++)           //checks each digit of secret code with all digits of guess code
        {
            if (secretCodeVector[i] == guessVector[l])  
            {
                secretCodeVector[i] = array1[counter];
                guessVector[l] = array2[counter2];


                incorrectPlaceCorrectNum++;

                counter++;
                counter2++;
                break;
            }
        }

    }

    return incorrectPlaceCorrectNum;

}
</code></pre>
