So I'm trying to learn how to use openMP on a OSX Yosemite however stock gcc doesn't seem to support openMP so I installed gcc 4.9 from homebrew. The problem occurs when I try to compile the following code using this command: gcc-4.9 main.cpp -fopenmp -o program
#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());
}
I get the following error:
Undefined symbols for architecture x86_64:
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in cccRGd8K.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
Any ideas on what it means?