PDA

View Full Version : Qt + OpenMP missing pthreadGC2.dll



Sanuden
29th January 2010, 15:22
I'm trying to get an OpenMP application to compile using Qt Creator (SDK 2010.01) in Windows and after getting everything to compile, when I try to run the application I get an error message: "The program can't start because pthreadGC2.dll is missing from your computer. Try reinstalling the program to fix this problem." I figured this might just be a path issue so I did a search in the Qt installation folder for the missing dll and unfortunately it doesn't seem to be present. I was wondering if this is something that I need to compile independently and doesn't come packaged in Qt's mingw by default?

FYI, the pro file I'm using is:


#-------------------------------------------------
#
# Project created by QtCreator 2010-01-29T09:32:03
#
#-------------------------------------------------

QT -= gui

TARGET = OmpTest
CONFIG += console
CONFIG -= app_bundle

QMAKE_CXXFLAGS += -fopenmp

TEMPLATE = app

SOURCES += main.cpp

LIBS += -lgomp

and the only source file is:


#include <omp.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
#pragma omp parallel
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
}

Thanks in advance.

Sanuden
30th March 2010, 14:13
In case anyone is also having this problem, I found this website (http://sourceforge.net/apps/mediawiki/qtpfsgui/index.php?title=Compiling_on_Windows) which gave me a clue where to look for the pthreads library. Once I downloaded the source code for the latest version (2.8.0) from ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz, I compiled using Msys with the command "make clean CG". That produced the pthreadGC2.dll that I was missing, and once I copied the dll into the release folder of my Qt Project (where the executable was running from) everything worked fine.