Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Proper way to Windows Qt development with pthread
Forum Update on Monday, May 27th 2025

Proper way to Windows Qt development with pthread

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 431 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RahibeMeryem
    wrote on last edited by
    #1

    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?

    JKSHJ 1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

      https://stackoverflow.com/questions/2150938/can-i-get-unixs-pthread-h-to-compile-in-windows
      if linux
      do this
      else if windows
      do that
      endif

      or simply use QThread?
      The QThread class provides a platform-independent way to manage threads.
      https://doc.qt.io/qt-5/qthread.html

      R 1 Reply Last reply
      1
      • JoeCFDJ JoeCFD

        https://stackoverflow.com/questions/2150938/can-i-get-unixs-pthread-h-to-compile-in-windows
        if linux
        do this
        else if windows
        do that
        endif

        or simply use QThread?
        The QThread class provides a platform-independent way to manage threads.
        https://doc.qt.io/qt-5/qthread.html

        R Offline
        R Offline
        RahibeMeryem
        wrote on last edited by
        #3

        @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);
            }
        }
        
        JoeCFDJ 1 Reply Last reply
        0
        • R RahibeMeryem

          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?

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @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

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          2
          • R RahibeMeryem

            @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);
                }
            }
            
            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #5

            @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

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved