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. Generating a .so for a dylib linking to static Qt
QtWS25 Last Chance

Generating a .so for a dylib linking to static Qt

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 456 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.
  • D Offline
    D Offline
    dmichler
    wrote on last edited by
    #1

    I have a project building a .so library using

    CONFIG += dylib
    

    which builds successfully with the standard Qt kit (5.10 + GCC), generated all the files I expect.

    However, when I switch to the static build of Qt I built, no .so is generated. The .a and .o files are generated as expected, and I can call a manual call with QMAKE_POST_LINK that looks like:

    g++ -shared -o  <libname>.so  .....
    

    Which works successfully, but I expect that this would be done automatically with the dylib config, as it is when linking to the downloaded qt kit.

    Is there some configuration that would cause this? A misunderstanding with how I have added the static qt build kit? Adding a custom g++ call with QMAKE_POST_LINK seems heavy handed.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Based on memories and the CONFIG variable documentation, I'd try to add CONFIG += shared.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • D Offline
        D Offline
        dmichler
        wrote on last edited by
        #3

        Thank you, that does resolve the issue! I had tried adding shared to linker flags, but not to the CONFIG.

        Any reason you can think that it would work for one kit but not another?

        Thanks!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          That's a good question and I don't know currently. But I think it would make sense to build projects in the same mode as Qt has been built if nothing is specified.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • D Offline
            D Offline
            dmichler
            wrote on last edited by
            #5

            Well, I suppose that makes sense. Thanks for your help!

            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