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 30 Sept 2021, 20:02 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?

    J 1 Reply Last reply 1 Oct 2021, 06:35
    0
    • J Offline
      J Offline
      JoeCFD
      wrote on 30 Sept 2021, 20:11 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 Oct 2021, 06:21
      1
      • J JoeCFD
        30 Sept 2021, 20:11

        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 1 Oct 2021, 06:21 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);
            }
        }
        
        J 1 Reply Last reply 1 Oct 2021, 13:46
        0
        • R RahibeMeryem
          30 Sept 2021, 20:02

          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?

          J Offline
          J Offline
          JKSH
          Moderators
          wrote on 1 Oct 2021, 06:35 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
            1 Oct 2021, 06:21

            @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);
                }
            }
            
            J Offline
            J Offline
            JoeCFD
            wrote on 1 Oct 2021, 13:46 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

            1/5

            30 Sept 2021, 20:02

            • Login

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