omp.cpp
#include <iostream> #include <omp.h> int main() { std::cout << "Start" << std::endl; #pragma omp parallel { std::cout << "Hello "; std::cout << "World! " << std::endl; } std::cout << "End" << std::endl; } I've tried to compile the above code with g++ omp.cpp -fopenmp but I get the error:
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lpthread collect2.exe: error: ld returned 1 exit status I've tried googling what -lpthread is but I couldn't find anything. The closest thing I found was another thread in which someone compiled his/her code like this: g++ omp.cpp -fopenmp -lpthread ... but the result is the same for me.
Am I missing something? Much appreciated in advance.