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. How can I use winapi in Qt
Forum Updated to NodeBB v4.3 + New Features

How can I use winapi in Qt

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 1.4k 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.
  • D Offline
    D Offline
    DongMK
    wrote on 20 Apr 2017, 15:36 last edited by
    #1

    I want include windows.h header. But I can't build my project. It report "undefined reference to _imp__GetDeviceCaps@8". I cannot use any winapi.
    I use Qt5.8.0-mingw. How to fix It.

    M 1 Reply Last reply 20 Apr 2017, 15:37
    0
    • D DongMK
      20 Apr 2017, 15:36

      I want include windows.h header. But I can't build my project. It report "undefined reference to _imp__GetDeviceCaps@8". I cannot use any winapi.
      I use Qt5.8.0-mingw. How to fix It.

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 20 Apr 2017, 15:37 last edited by mrjj
      #2

      @DongMK Hi
      u must also link to the dll that gives the function.

      Eaxmple
      https://msdn.microsoft.com/en-us/library/windows/desktop/dd144877(v=vs.85).aspx

      the GetDeviceCaps lives in
      Gdi32.lib (DLL)

      so you must add to your .pro file
      LIBS += -lgdi32

      1 Reply Last reply
      2

      1/2

      20 Apr 2017, 15:36

      • Login

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