Unrecognized pragma: Reduction clause | openMP
===

For the code below I get an error: `unrecognized #pragma: #pragma omp reduction (+: sum)`. Could you say where is the problem?

**Main cpp file:**

    #include <omp.h>
    
    int main ()
    {
        #pragma omp parallel
        {
            function ();
        }
    }
    
**Another cpp file wherein function defined**

    #include <omp.h>

    void function ()
    {
        T priv_var;
    
        // some calculations
    
        #pragma omp reduction (+: sum)  // sum is a shared variable
        {
            for (;;)
            {
                sum = sum + priv_var;
            }
        }
    }