Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Error: LNK1104: cannot open file 'gdi32.lib'

Error: LNK1104: cannot open file 'gdi32.lib'

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 6 Posters 30.7k 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.
  • T Offline
    T Offline
    ted_kingdom
    wrote on last edited by
    #1

    Hi, I installed Qt, but while building the project I get an error: LNK1104: cannot open file 'gdi32.lib' ("Your text to link here...":http://www.evernote.com/shard/s104/sh/9b17a5d1-d363-4417-a12f-ccffc75e1216/50e75f1d9e8d78e4b1c2014b42026c8d). How can I fix it? Thanks in advance!

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xtal256
      wrote on last edited by
      #2

      gdi32.lib is a standard Windows library (for the "graphics device interface":http://msdn.microsoft.com/en-us/library/windows/desktop/dd145203(v=vs.85).aspx).
      If the linker cannot find it, then maybe you haven't properly set things up. Are you are using Visual Studio?

      EDIT: Oh, i just saw your image. You are using the Qt Creator. In that case, what compiler have you installed?

      --=[[url="http://tinyurl.com/l6wan2m"][color=#cc0000]War Thunder[/color][/url]]=--

      1 Reply Last reply
      1
      • T Offline
        T Offline
        ted_kingdom
        wrote on last edited by
        #3

        http://postimage.org/image/9rv8qt5sn/
        I tried all of them - no luck

        1 Reply Last reply
        0
        • X Offline
          X Offline
          xtal256
          wrote on last edited by
          #4

          I see. I have not used Creator before, so i wasn't sure how it was supposed to be setup. But i can see from your image that it has detected both the Microsoft compiler and the SDK, so i'm not sure why it can't find gdi32.lib.

          Perhaps you could search your computer for that file and see if it actually exists anywhere. Then check if that directory is in Creator's list of lib directories. I assume there is some option in Creator to add additional lib directory paths.

          --=[[url="http://tinyurl.com/l6wan2m"][color=#cc0000]War Thunder[/color][/url]]=--

          1 Reply Last reply
          0
          • T Offline
            T Offline
            ted_kingdom
            wrote on last edited by
            #5

            Yes, I tried that. It helped a little. But then another error occured. So I just found a decent distribution (http://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/Qt-Builds/) which works properly so far. Thank you for your help anyway.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              godzilloff
              wrote on last edited by
              #6

              [quote author="ted_kingdom" date="1358208657"]error: LNK1104: cannot open file 'gdi32.lib'[/quote]

              Hi! Possible during the installation was removed libs system variable "PATH". If the command line does not load calculator (win + R -> cmd -> calc), and empty "PATH" variable when calling the command "set". The solution for me was to System Restore, and reinstalling Visual Studio + Qt

              1 Reply Last reply
              0
              • C Offline
                C Offline
                changedsoul
                wrote on last edited by
                #7

                Hi, can someone give me a hand with this? I am also getting this error. I was using qt5.0.1 32 bit with MSVC2010 compiler and works great. I wanted to make a 64bit version of my app so I noticed there was a Qt 5.0.2 64bit version available for MSVC2012.
                I downloaded this Qt 5.0.2 version and installed VS 2012 EXP hoping I could now compile a 64bit app.

                I open my project, try and compile, and I get this error: LINK : fatal error LNK1104: cannot open file 'gdi32.lib'
                NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\x86_amd64\link.EXE"' :

                What might I do to get this work?

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  Raparee
                  wrote on last edited by
                  #8

                  Hi,

                  Is this issue still open?

                  I had the same issue, and fixed it easily. gdi32.lib is in the Windows SDK. For Qt 5.0.2 using MSVC2012, you need to have the Microsoft Windows 8 SDK. It's possible that you have the Windows 7 SDK, in which case you will have the gdi32.lib but the compiler won't find it.

                  You can check if this is the problem by going to the Windows SDK directory and taking a look. Usually it's here:

                  C:\Program Files (x86)\Microsoft SDKs\Windows

                  There will likely be the v7.0A directory. You need the v8.0 and v8.0A directories to be there. If they are missing, get the SDK from here:

                  http://msdn.microsoft.com/en-us/library/windows/desktop/hh852363.aspx

                  Download and install the Windows 8 SDK and it should just work.

                  -Rap.

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    Whol001
                    Banned
                    wrote on last edited by
                    #9
                    This post is deleted!
                    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