Qt Creator LNK1104 - fixing "shell32.lib" error then creates "shell32d.lib" error



  • I'm completely new to Qt: I downloaded and installed Qt Creator by downloading:
    qt-unified-windows-x86-2.0.2-2-online.exe

    I then started a new project and then tried to build and run it (without making any changes to the default program), which gave me the following error:
    LNK:1104: cannot open file 'shell32.lib'

    I can verify that shell32.lib exists in the directory: C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\um\x86

    I have been googling the problem and apparently the solution is to add shell32.lib as a library to the project (if I've misunderstood this, please let me know).
    I've clicked "Add Library" and selected "External Library". I've then selected the file and the path (keeping all the default
    options). This adds the following to my .pro file:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.10586.0/um/x86/' -lshell32
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.10586.0/um/x86/' -lshell32d
    else:unix: LIBS += -L$$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.10586.0/um/x86/' -lshell32
    
    INCLUDEPATH += $$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.10586.0/um/x86'
    DEPENDPATH += $$PWD/'../../../../Program Files (x86)/Windows Kits/10/Lib/10.0.10586.0/um/x86'
    

    This changes the error to:
    LNK:1104: cannot open file 'shell32d.lib'

    i.e. "shell32.lib" becomes "shell32d.lib".

    Information on "shell32d.lib"on Google is essentially non-existent. Searching for the file gives me exactly two hits, one of which is in Polish: https://www.google.com.au/#q="shell32d.lib"

    I have uninstalled Qt Creator, redownloaded the .exe file and installed it again. This has no effect.

    I haven't done anything or downloaded anything other than what I've mentioned. If there's something else I was meant to do, it's because I didn't realise I was meant to.

    Any help would be appreciated.
    Thanks in advance.


  • Qt Champions 2016

    hi
    What compile do you install for ?

    Normally, this one
    http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-mingw492-5.5.1.exe
    just works out of the box.





  • @mrjj said:

    Once your problem is solved please do:
    Use the Topic Tools button to mark as Solved
    (first post, not the gear thing, under the post)
    Upvote the answer(s) that helped you to solve the issue
    postimage.org can be used for screenshots. Thank you.

    I've been using the default "build" setting in Qt Creator. If I was meant to install the compiler separately that's probably what the problem is!

    I'm downloading from the link you gave me right now. I'll let you know if it works.


  • Qt Champions 2016

    well
    Unless you are using mingw,
    you need to install Visual Studio your self :)
    like for
    MSVC2013 64 bit



  • I just installed the link at: http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-mingw492-5.5.1.exe

    I now have two versions of Qt Creator on my computer, but unfortunately both of them are producing the same error!

    I already have Visual Studio 2015 on my computer, but I don't have Visual Studio C++. I'm installing that now from this link: https://www.microsoft.com/en-au/download/details.aspx?id=40784

    Edit:
    Visual Studio C++ installed much quicker than I expected.

    I can now build and run a basic program in Qt Creator! At the moment just a blank window is popping up because I haven't added anything, but it works! I don't even have to add the shell32.lib file to the library of the project.

    Thanks for your help!


  • Moderators

    After installing the MinGW version did you run qmake and a complete rebuild?



  • I did and that didn't work.

    The problem has since been solved by installing Microsoft Visual C++ (which I incorrectly believed was the same as Visual Studio).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.