Important: Please read the Qt Code of Conduct -

Qt Creator fails to update project when removing static lib

  • Hey Qt community!
    I am having a Qt subproject that is linking against a static library (boost filesystem) like so:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../3rdParty/boost/lib/win/ -llibboost_filesystem-vc141-mt-x64-1_72
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../3rdParty/boost/lib/win/ -llibboost_filesystem-vc141-mt-gd-x64-1_72
    else:unix: LIBS += -L$$PWD/../3rdParty/boost/lib/macos/ -lboost_filesystem
    INCLUDEPATH += $$PWD/../3rdParty/boost/include
    DEPENDPATH += $$PWD/../3rdParty/boost/include
    win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../3rdParty/boost/lib/win/libboost_filesystem-vc141-mt-x64-1_72.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../3rdParty/boost/lib/win/libboost_filesystem-vc141-mt-gd-x64-1_72.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../3rdParty/boost/lib/macos/libboost_filesystem.a

    When I remove the static library (so the entire block) from the .pro file of my subproject I do get an error when building:

    :-1: error: LNK1104: cannot open file 'libboost_filesystem-vc141-mt-gd-x64-1_72.lib'

    I tried all kinds of things like restarting Qt Creator, rebuilding, cleaning, deleting the shadow build directory. Nothing seems to work. I really don't understand why Qt Creator continues to look for the .lib.
    Is there any cache I am missing?

    My selected Kit is MSVC 2017 15.9 (amd64), Qt 5.13.0 MSVC2017 (64 bit)

    Thanks for your help!

  • Lifetime Qt Champion

    Hi @J0Nes,

    please check if you have a stale Makefile laying around.


  • Hey,

    nope, the only makefile is in the shadowbuild directory which I explicitly delete

  • Turns out that just including boost/process.hpp auto links against the mentioned library. I was not aware that this is even possible.
    Thanks for your help

Log in to reply