Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Creating and using Static Library with Qt iOS
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Creating and using Static Library with Qt iOS

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 3.8k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    Mammamia
    wrote on 29 Jul 2013, 05:08 last edited by
    #1

    I have a project which has two part 1. Widgets Library and 2. Run-time... In Windows and Linux i was using Widgets as a Library and loading Dynamically with the Run-time. Currently i am porting my app to iOS and i found that we can use only Statically linked libraries in iOS app. How can i make my Widgets library as statically linked with Run-time in iOS app.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 29 Jul 2013, 07:45 last edited by
      #2

      since you link your code statically you can just skip the loading-part.
      e.g. you can do this by surrounding your library loading code with "Qt's platform macros":https://qt-project.org/doc/qt-5.1/qtcore/qtglobal.html#Q_OS_IOS, or you define your own macros at compile time.
      @
      #ifndef Q_OS_IOS
      //loading of widget library
      #endif
      return widget;
      @

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mammamia
        wrote on 29 Jul 2013, 08:03 last edited by
        #3

        Thanks Raven for the Reply,
        I found the solution i was using the default method for Creating Static Library "Click here":http://qt-project.org/wiki/How_to_create_a_library_with_Qt_and_use_it_in_an_application#fcaa56d9b97ba0f5703da2272539579e .
        Inside widgets.pro
        @TEMPLATE += lib
        CONFIG += staticlib@

        Inside Runtime.pro
        @INCLUDEPATH += ../src
        LIBS += -L ../Runtime -lWidgets@

        And it Works fine... :)

        1 Reply Last reply
        0

        1/3

        29 Jul 2013, 05:08

        • Login

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