[Solved] Unable to reference external library



  • Hello

    I have an issue when I try to build my Qt app (within Qt creator, MVSC2013 compiler). I need to include the Bloomberg C++ API and I think this is what is the caused of my issue.
    I have used the Qt tool to add the external library, and the following script has been generated in the .pro file:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/API/APIv3/C++API/v3.8.18.1/lib/ -lblpapi3_64
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/API/APIv3/C++API/v3.8.18.1/lib/ -lblpapi3_64d
    else:unix: LIBS += -L$$PWD/API/APIv3/C++API/v3.8.18.1/lib/ -lblpapi3_64

    INCLUDEPATH += $$PWD/API/APIv3/C++API/v3.8.18.1/include
    DEPENDPATH += $$PWD/API/APIv3/C++API/v3.8.18.1/include

    But I have the following message in the "Issues tab" when I try to build the project (after running qmake):
    LNK1104: cannot open file 'blpapi3_64d.lib'

    Can you help me please?



  • I am using
    LIBS = -L$${PWD}/../../bin/lib/
    -llaunchy.qxt

    and it worked. Maybe missing braces?


  • Lifetime Qt Champion

    Hi,

    Is your project located in a path with spaces ?



  • Hi slesa, SGaist

    I have tried to add the LIBS manually before using LIBS += "libpath" but it didn't work so I decided to use the tool to be sure it is not a syntax error.
    The project is not located in a path with spaces, so there's no need for braces.


  • Lifetime Qt Champion

    Might be a silly question but, are you sure you have both debug and release libraries for blpapi3_64 ?



  • Hi SGaist

    Actually it is not that silly... ;)
    I had only the release version, I deleted the link to the debug library (which was automatically added by the Qt tool, because I had ticked "Add 'd' for debug version") and now it works perfectly.
    Thanks for your help :) Cheers


  • Lifetime Qt Champion

    You're welcome !

    Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)


Log in to reply
 

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