c++ & OpenMP : undefined reference to GOMP_loop_dynamic_start

Ich bin stecken, Folgendes problem : zuerst habe ich kompilieren Sie die folgende Datei cancme.cpp :

void funct()
{
int i,j,k,N;
double s;
#pragma omp parallel for default(none) schedule(dynamic,10) private(i,k,s) shared(j,N)
for(i=j+1;i<N;i++) {}
}

durch:

mingw32-g++.exe -O3 -std=c++11 -mavx -fopenmp -c C:\pathtofile\cancme.cpp -o C:\pathtofile\cancme.o

Nächstes Baue ich eine zweite Datei, test.cpp einfach eine Verknüpfung cancme.o mit :

int main()
{
return(0);
}

durch:

mingw32-g++.exe -O3 -std=c++11 -mavx -fopenmp -c C:\pathtofile\test.cpp -o C:\pathtofile\test.o

Beim verknüpfen es mit cancme.o, von :

mingw32-g++.exe  -o C:\pathtofile\test.exe C:\pathtofile\test.o  -lgomp  C:\pathtofile\cancme.o

Bekomme ich folgende Fehlermeldungen :

C:\pathtofile\cancme.o:cancme.cpp:(.text+0x39): undefined reference to  `GOMP_loop_dynamic_start'
C:\pathtofile\cancme.o:cancme.cpp:(.text+0x49): undefined reference to `GOMP_loop_dynamic_next'
C:\pathtofile\cancme.o:cancme.cpp:(.text+0x52): undefined reference to `GOMP_loop_end_nowait'
C:\pathtofile\cancme.o:cancme.cpp:(.text+0x92): undefined reference to `GOMP_parallel_start'
C:\pathtofile\cancme.o:cancme.cpp:(.text+0x9f): undefined reference to   `GOMP_parallel_end'

Hat jemand eine Idee, was da schief??? Der OpenMP-Bibliothek korrekt verbunden durch die -lgomp Flagge, aber es ist so wie es war, nicht erkannt.

Hinweis : ich benutze MingW 4.8.1 c++ - compiler unter windows 7 64 bit:

danke

renato

InformationsquelleAutor Teol11 | 2015-05-22
Schreibe einen Kommentar