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. PdhOpenQuery eror
Qt 6.11 is out! See what's new in the release blog

PdhOpenQuery eror

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 3.7k Views 1 Watching
  • 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.
  • 1 Offline
    1 Offline
    1990sasha
    wrote on last edited by
    #1

    @#include <windows.h>
    #include <pdh.h>
    #include <pdhmsg.h>
    static HQUERY hQuery;
    PdhOpenQuery(NULL, 0, &hQuery);@

    Hello everyone. in Qt insert this code and so we get an error "undefined reference to `PdhOpenQueryW@12' "
    how to solve this problem. thanks!!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you linking to the Pdh library ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • 1 Offline
        1 Offline
        1990sasha
        wrote on last edited by
        #3

        in qt only pdh.h there, pdh.lib no.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          PdhOpenQuery is not a part of Qt, it's a Windows function given through the Pdh library, so if you want to use it you need to link to that library

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rakeshlakkappa
            wrote on last edited by
            #5

            hI all,
            please suggest how to link pdh library.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rakeshlakkappa
              wrote on last edited by
              #6

              hI all,
              please suggest how to link pdh library.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi,

                @LIBS += -lPdh@

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi,

                  @LIBS += -lPdh@

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • R Offline
                    R Offline
                    rakeshlakkappa
                    wrote on last edited by
                    #9

                    Thank you.

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      rakeshlakkappa
                      wrote on last edited by
                      #10

                      Thank you.

                      1 Reply Last reply
                      0

                      • Login

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