Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to set a link to a library in the “Link Binary With Libraries” list from a .pro file



  • The library was added to the .pro file with the following lines:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Libraries/release/ -lvclient_iphone_sim_release
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Libraries/debug/ -lvclient_iphone_sim_release
    else:unix: LIBS += -L$$PWD/Libraries/ -lvclient_iphone_sim_release
    
    INCLUDEPATH += $$PWD/Libraries
    DEPENDPATH += $$PWD/Libraries
    
    win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/Libraries/release/libvclient_iphone_sim_release.a
    else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/Libraries/debug/libvclient_iphone_sim_release.a
    else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/Libraries/release/vclient_iphone_sim_release.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/Libraries/debug/vclient_iphone_sim_release.lib
    else:unix: PRE_TARGETDEPS += $$PWD/Libraries/libvclient_iphone_sim_release.a
    

    Then, in Xcode, you have to manually change the link of the library in the list (seen in the photo).

    Rb71Q.jpg
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    e6Zkt.jpg

    QUESTION: Is it possible to somehow set the linking order of the library directly from the .pro file for generation in Xcode?!


  • Lifetime Qt Champion

    Why do you need to change it?



  • @Christian-Ehrlicher said in How to set a link to a library in the “Link Binary With Libraries” list from a .pro file:

    Why do you need to change it?

    Because the order of libraries, in the generated Xcode project cause crash. If I change order - it starts works fine.

    Guys here say, that this is not the first time in their history when other of libraries DO matter.


  • Lifetime Qt Champion

    It does not work with qmake and I would rather search the bug in the lib you link against.