I'm trying to run this simple OpenMP example :
#include <iostream>
#include <omp.h>
using namespace std;
int main()
{
switch(_OPENMP) {
case 200805:
cout << "OpenMP version 3.0 has macro value of 200805" << endl;
break;
case 200505:
cout << "OpenMP version 2.5 has macro value of 200505" << endl;
break;
default:
cout << "Unrecognized OpenMP version of " << _OPENMP << endl;
break;
}
return 0;
}
I get two undefined reference to
errors :
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../crt2.o:(.text+0x1ee): undefined reference to `_CRT_fenv'
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../crt2.o:(.text+0x1fb): undefined reference to `_setargv'
collect2.exe: error: ld returned 1 exit status
I already added libgomp-1.dll
to link librairies and -fopenmp
to other compiler options ( I'm working with code::blocks by the way ).