This is because you might be tempted to un-comment the code of the graph class. You are not supposed to un-commnet. Just implement the logic as is asked.
void addEdge(int v,int w);
/*You are required to complete this method*/
bool Graph :: isCyclic()
//Your code here
Graph g = new Graph();
If you try, this you get the error that you are mentioning. But if you just update the code at the line //Your code here, you do not get any error of that kind.