Art*_*yom 2 c c++ makefile openmp
我正在尝试在我的项目中开始使用 open mp。我有这样的代码:
#pragma omp for
for (i = 0; i < 16; i++) {
resBuf[i] = buf1[i] ^ buf2[i];
}
Run Code Online (Sandbox Code Playgroud)
我包含<omp.h.>在文件的开头。我还尝试在 makefile 中使用不同的标志及其组合:
FLAGS = -Wall -g -fopenmp -lgomp -fgomp
CC = gcc
Run Code Online (Sandbox Code Playgroud)
还是不行。有以下问题:
undefined reference to `omp_get_num_threads'
undefined reference to `omp_get_thread_num'
undefined reference to `GOMP_barrier'
Run Code Online (Sandbox Code Playgroud)
你能帮助我吗?