hello , i am new to open mp and i tried an sample program from the official site
#include <omp.h>
#include <stdio.h>
int main() {
#pragma omp parallel
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
}
and i have set the library in the eclipse as libgomp in project Properties->GCC c++ linker-
but the program say /usr/bin/ld: cannot find -llibgomp can i know where i am wrong
From stackoverflow
-
Try linking with
gompinstead oflibgomp: library names must be passed to the linker without thelibprefix, which it adds automatically. Hence the error, it is trying to findliblibgomp. Don't forget the compiler flag-fopenmp, otherwise the OpenMP pragmas will simply be ignored.
0 comments:
Post a Comment