【发布时间】:2018-09-13 14:55:07
【问题描述】:
我是 C++ 编程的新手。在 openMP 中也是新的。 我有这个简单的代码
#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;
}
当我尝试使用
编译它时g++ -fopenmp file_name.cpp
在 cmd 中,我收到此错误
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot
find -lpthread collect2.exe: error: ld returned 1 exit status
我用的是windows 10,gcc版本是6.3.0。 我怎样才能解决这个问题? 谢谢
【问题讨论】:
标签: c++ compilation g++ openmp