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. Joining static libraries into a shared library
Forum Updated to NodeBB v4.3 + New Features

Joining static libraries into a shared library

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.6k 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.
  • K Offline
    K Offline
    kuraudo
    wrote on last edited by
    #1

    -I'm beginning work on what will be a fairly medium-sized application using the subdirs template. Right now, the subdirs branch off to make libraries, with one subdir going to the application. This seems fine with all of the libraries statically linked. Now, I'm trying to group multiple static libraries in a subdir into a single shared library for that subdir. For example:

    @root
    .main - the application core, importing gui.dll/gui.so
    .gui
    ..widgetA - static library encapsulating widgetA
    ..widgetB - static library encapsulating widgetB
    ..gui - shared library exporting widgetA and widget@

    This seems to me to be the best way to approach scaling this application, as any number of these static libraries can be quite large and this organizes dependencies quite well. I'm just not sure how to take the imports from static libraries widgetA and widgetB, and make them exports in the gui library.

    Thanks!-

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      It seems you are on Linux. You might find these informative:

      • http://stackoverflow.com/questions/2649735/how-to-link-static-library-into-dynamic-library-in-gcc
      • http://stackoverflow.com/questions/655163/convert-a-static-library-to-a-shared-library

      You should be able to use the whole archive options in your LIBS variable.
      @
      LIBS += -Wl,--whole-archive -lfirst -lsecond -Wl,--no-whole-archive
      @

      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