Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set a link to a library in the “Link Binary With Libraries” list from a .pro file
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
iosqt creatorlibrarieslinkxcode
4 Posts 2 Posters 960 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.
  • W Offline
    W Offline
    Wargos
    wrote on last edited by Wargos
    #1

    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?!

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Why do you need to change it?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Wargos
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved