Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QT build statically with statically linked psql
Forum Updated to NodeBB v4.3 + New Features

QT build statically with statically linked psql

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
macos5.15.2macos5.15.2psqlstatic linking
4 Posts 2 Posters 773 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.
  • D Offline
    D Offline
    Dilshat
    wrote on last edited by
    #1

    Hi!

    I've configured my qt statically on MacOS 11.5 (BigSur) using qt 5.15.2

    ./configure -prefix ~/opt/qt5 -static -nomake tests -nomake examples -skip qtwebengine -opensource -release -sql-psql
    

    It works but libpq links as a shared library

    	/usr/local/opt/postgresql/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.13.0)
    

    Is it possible to include libpq to a build as a static dependency? How can do that?

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

      Hi and welcome to devnet,

      For that you need a static PostgreSQL library.

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

      D 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        For that you need a static PostgreSQL library.

        D Offline
        D Offline
        Dilshat
        wrote on last edited by Dilshat
        #3

        @SGaist thanks for reply! I have libpq.a file that is a static psql library. I also deleted the dynamic version. But qt still trying to find the dynamic version and ignores the static one. How can I specify the static version to be used?

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

          If you removed the dynamic one, how does it still find it ?

          You can modify the .pro file and pass the complete path to the static library

          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
          0

          • Login

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