I'm using stack in my code and it shows this error. Other questions say I have circular dependency but I only have 1 header file
//function.h
#pragma once 
void dfs(int start, int goal, bool visited[], int **matrix, int size,
         bool &found, stack<int>& path);
//function.cpp
#include "function.h"
#include <iostream>
#include <stack>
using namespace std;
void dfs(int start, int goal, bool visited[], int **matrix, int size,
         bool &found, stack<int>& path)
{
    visited[start] = true;
    cout<<start<<" ";
    path.push(start);
    if (start == goal)
        found = true;
    for (int k = 0; k < size; k++)
    {
        if (visited[k] == false && matrix[start][k] && found == false )
            dfs(k,goal,visited,matrix,size,found,path);
        path.pop();
    }
}
//main.cpp
#include "function.h"
#include <iostream>
#include <fstream>
#include <stack>
using namespace std;
void main()
{
    stack<int> path;
    for(int i=0; i<N; i++)
        visit[i] = false; //init visit
    for(int i = 0; i < N; ++i)
        matrix[i] = new int[N]; // build rows
    for(int i = 0; i < N; ++i)
    {
        for(int j = 0; j < N; ++j)
        {
            fin>>matrix[i][j];
        }
    }
    dfs(start, end, visit, matrix, 5, found, path);    
}
It should run but it keeps giving me this syntax error: "error C2061: syntax error : identifier 'stack' "
 
     
    