PDA

View Full Version : OpenMP problems with Qt Creator



Coocos
28th November 2010, 10:19
Hi.

I'm having some problems with OpenMP and Qt Creator. Everything I build that uses OpenMP seems to exit with code -1073741515.

Here's a small test that exits upon #pragma omp parallel. If I comment it out however, it works just fine.

#include <iostream>
#include <omp.h>

int main(int argc, char* argv[]) {

#pragma omp parallel
std::cout << "Hello, world!" << std::endl;
return 0;
}

And here's my .pro file. It seems to find the library just fine:


TARGET = OpenMP
TEMPLATE = app
SOURCES += main.cpp

QMAKE_CXXFLAGS += -fopenmp
QMAKE_LFLAGS += -fopenmp
CONFIG += console
LIBS += -lgomp


Any ideas?

Coocos
29th November 2010, 14:12
I solved it. Basically, for some reason I seem to be missing pthreadCG2.dll which OpenMP seems to depend on. You can either compile Pthreads yourself or just go to Google for the missing dll.