Blank output OpenMP program compiling with g++ on Windows

Viewed 22

I am compiling a OpenMP program using MinGW g++ (x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0) but get blank output.

My code:

#include <stdio.h>
#include <omp.h>

int main() {
    #pragma omp parallel
    {
        printf("%d\n", omp_get_thread_num());
    }
    printf("FIN\n");
    return 0;
}

Compile command:

g++ a.cpp -fopenmp

There is no error message. However, I run a.exe and get empty output.

Any idea?

0 Answers
Related