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. Error while linking with user32 library
QtWS25 Last Chance

Error while linking with user32 library

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 367 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.
  • P Offline
    P Offline
    peteradde
    wrote on last edited by
    #1

    it always tell winnt.h:169: error: C1189: #error: "No Target Architecture" when i tried to either use pragma or
    ```
    QFunctionPointer p;
    QLibrary *lib = new QLibrary("user32");
    if(lib->load() && (p = lib->resolve("SetWindowDisplayAffinity"))) {
    qDebug() << "Lib loaded";
    } else {
    qDebug() << "Lib could not load";
    }

     can someone help me with this please
    JonBJ 1 Reply Last reply
    0
    • P peteradde

      it always tell winnt.h:169: error: C1189: #error: "No Target Architecture" when i tried to either use pragma or
      ```
      QFunctionPointer p;
      QLibrary *lib = new QLibrary("user32");
      if(lib->load() && (p = lib->resolve("SetWindowDisplayAffinity"))) {
      qDebug() << "Lib loaded";
      } else {
      qDebug() << "Lib could not load";
      }

       can someone help me with this please
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @peteradde
      And what is the code in winnt.h around line #169 which leads to this...?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        peteradde
        wrote on last edited by
        #3

        @JonB
        e0354345-e02c-4dd6-b4c3-bb5307f43cf8-image.png

        JonBJ 1 Reply Last reply
        0
        • P peteradde

          @JonB
          e0354345-e02c-4dd6-b4c3-bb5307f43cf8-image.png

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @peteradde
          So it looks to me as though you need to have defined an "architecture" symbol (perhaps _X86_?) so that line #159 leads to line #160.

          And I don't know where this file is included into your code from, since you mention nothing about #includes, or whether it's supposed to be included or whether it's not supposed to reach that line.

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Your piece of code and the error message have nothing in common. Please provide a minimal compileable example to reproduce your issue.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            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