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
Forum Updated to NodeBB v4.3 + New Features

Error while linking with user32 library

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 381 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 18 Jul 2022, 12:26 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
    J 1 Reply Last reply 18 Jul 2022, 12:37
    0
    • P peteradde
      18 Jul 2022, 12:26

      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
      J Offline
      J Offline
      JonB
      wrote on 18 Jul 2022, 12:37 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 18 Jul 2022, 13:11 last edited by
        #3

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

        J 1 Reply Last reply 18 Jul 2022, 14:30
        0
        • P peteradde
          18 Jul 2022, 13:11

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

          J Offline
          J Offline
          JonB
          wrote on 18 Jul 2022, 14:30 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
          • C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 18 Jul 2022, 14:57 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

            3/5

            18 Jul 2022, 13:11

            • Login

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