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. Qt 5.15.2, Mac OSX and PostgreSql
Forum Updated to NodeBB v4.3 + New Features

Qt 5.15.2, Mac OSX and PostgreSql

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 835 Views 2 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.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi, I have a strange problem with Qt and PostgreSql on Mac OSX.
    My portable app connects to PostgreSql server. The app has got in "Contents/Frameworks" folder the PostgreSql lib.
    On Mac OSX High Sierra, Catalina and Big Sur everitying works well. In Mac OSX Monterey I have the error "driver not loaded".
    If the app works on High Sierra, Catalina and Big Sur it that means that the package in weell made.
    Why the app does not work in Monterey?

    Did anyone got problems with Qt - sql plugins - PostgreSql and different MacOS versions?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

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

      Hi,

      Are all the machines you are using to test that runningon the same processor architecture ?

      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
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by
        #3

        Hi. I don't know. The customer mac where the software works was been Big Sur (Mac book air). The customer mac where the software didn't work has been Monterey but I don't know which model it was.
        Have you got a mac?

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

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

          From an educated guess, the former has an Intel based Mac while the latter has likely an ARM based machine. Check that the PostgreSQL librairies you are shipping also contains both architecture.

          Yes, I do.

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

          mrdebugM 1 Reply Last reply
          0
          • SGaistS SGaist

            From an educated guess, the former has an Intel based Mac while the latter has likely an ARM based machine. Check that the PostgreSQL librairies you are shipping also contains both architecture.

            Yes, I do.

            mrdebugM Offline
            mrdebugM Offline
            mrdebug
            wrote on last edited by mrdebug
            #5

            In order to have my app working with PostgreSQL I have included in "Contents/Frameworks/" folder the PosgreSQL files "libpq.dylib, libpq.5.dylib, libpq.5.6.dylib" and I have run the command

            install_name_tool -change /Applications/Postgres.app/Contents/Versions/9.6/lib/libpq.5.dylib @rpath/libpq.5.dylib Handyman.app/Contents/PlugIns/sqldrivers/libqsqlpsql.dylib

            and the app works in High Sierra, Catalina e Big Sur (based on Intel cpu).

            • So, in order to have my app working on Monterey (probably arm based) which library have I do add?
            • Can I use the same app package or have I to bring app a specified app package for amr?
            • Why my app works in Monterey (probably arm) except the PostgreSQL connection?

            Need programmers to hire?
            www.labcsp.com
            www.denisgottardello.it
            GMT+1
            Skype: mrdebug

            SGaistS 1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #6

              Hi, best way I think to get your app to work both on Intel and Arm Macs is to build a Universal app that have binary code for both Intel and Arm in the same .exe file.

              This is for example how Qt Creator and the other executable files in the Qt distribution is built. You can check with the file command like this:

              file ~/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator
              

              and you should see both flavors listed.

              If you installed PostgreSql via Homebrew I suspect that package is not universally built. I.e. same problem that many in this forum encounter when building MySql. This is because Homebrew has a stated policy of not distributing universal binaries :-(

              You can request a universal build with the
              set(CMAKE_OSX_ARCHITECTURES x86_64 arm64) command in CMakeLists.txt or
              -DCMAKE_OSX_ARCHITECTURES="x86_64 arm64" in Terminal.

              1 Reply Last reply
              0
              • mrdebugM mrdebug

                In order to have my app working with PostgreSQL I have included in "Contents/Frameworks/" folder the PosgreSQL files "libpq.dylib, libpq.5.dylib, libpq.5.6.dylib" and I have run the command

                install_name_tool -change /Applications/Postgres.app/Contents/Versions/9.6/lib/libpq.5.dylib @rpath/libpq.5.dylib Handyman.app/Contents/PlugIns/sqldrivers/libqsqlpsql.dylib

                and the app works in High Sierra, Catalina e Big Sur (based on Intel cpu).

                • So, in order to have my app working on Monterey (probably arm based) which library have I do add?
                • Can I use the same app package or have I to bring app a specified app package for amr?
                • Why my app works in Monterey (probably arm) except the PostgreSQL connection?
                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @mrdebug As I wrote before, check the architectures available in your PostgreSQL libraries. You likely only have x86_64 for the one you are deploying with your application.

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

                mrdebugM 1 Reply Last reply
                0
                • SGaistS SGaist

                  @mrdebug As I wrote before, check the architectures available in your PostgreSQL libraries. You likely only have x86_64 for the one you are deploying with your application.

                  mrdebugM Offline
                  mrdebugM Offline
                  mrdebug
                  wrote on last edited by
                  #8

                  Many thanks for your replies. I'll go into detail in the next days. Best regards.

                  Need programmers to hire?
                  www.labcsp.com
                  www.denisgottardello.it
                  GMT+1
                  Skype: mrdebug

                  SGaistS 1 Reply Last reply
                  0
                  • mrdebugM mrdebug

                    Many thanks for your replies. I'll go into detail in the next days. Best regards.

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Seeing the PostgreSQL version you have (9.6), I am fairly certain that your issue is that you have an Intel only build or a ppc64/x86_64 at best.

                    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