Proper way to Windows Qt development with pthread
-
Hi,
I am Linux guy and for windows really rookie.
my simple project requires :
ncnn (I managed to compile)
pthread
opencv(managed to compile)But building complains pthread not available etc.
What sthe decent way to develop and and succesfully run linuxx project ie mobilenet face detection ncnn on windows.?
is it possible?
-
https://stackoverflow.com/questions/2150938/can-i-get-unixs-pthread-h-to-compile-in-windows
if linux
do this
else if windows
do that
endifor simply use QThread?
The QThread class provides a platform-independent way to manage threads.
https://doc.qt.io/qt-5/qthread.html -
@JoeCFD what would be the best conversion to the QThread of the :
#pragma omp parallel sections { #pragma omp section { if (left < j) qsort_descent_inplace(faceobjects, left, j); } #pragma omp section { if (i < right) qsort_descent_inplace(faceobjects, i, right); } }
-
@RahibeMeryem said in Proper way to Windows Qt development with pthread:
But building complains pthread not available etc.
pthread is available with the MinGW compiler, but not the Microsoft Visual C++ compiler
what would be the best conversion to the QThread of the :
#pragma omp parallel sections { #pragma omp section { if (left < j) qsort_descent_inplace(faceobjects, left, j); } #pragma omp section { if (i < right) qsort_descent_inplace(faceobjects, i, right); } }
For this, QtConcurrent might be better suited than QThread: https://doc.qt.io/qt-5/qtconcurrent-index.html
-
@RahibeMeryem said in Proper way to Windows Qt development with pthread:
#pragma omp parallel sections
OpenMP is supported by VS. You do not need pthread for it.
https://docs.microsoft.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support?view=msvc-160