Reputation: 25
i'm new in c++ programming. Also new in openMP. I have this simple code
#include <stdio.h>
#include <omp.h>
int main(int argc, char const *argv[])
{
#pragma omp parallel
printf("This is thread %d out of %d\n", omp_get_thread_num(), omp_get_num_threads());
return 0;
}
when i try to compile it using
g++ -fopenmp file_name.cpp
in the cmd, i get this error
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot
find -lpthread collect2.exe: error: ld returned 1 exit status
I use windows 10, and the gcc version is 6.3.0. How can i fix this? thanks
Upvotes: 0
Views: 3969