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. macOS Big Sur and Database driver
Forum Updated to NodeBB v4.3 + New Features

macOS Big Sur and Database driver

Scheduled Pinned Locked Moved Unsolved General and Desktop
28 Posts 3 Posters 3.5k 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.
  • SPlattenS SPlatten

    I know that macOS 11.1 Big Sur currently isn't officially supported. I have installed MariaDB 10.5.8 using Homebrew on my Mac. I've been through the loop of building the drivers:

    Go to:

    ~/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers
    

    First I remove the config.cache:

    rm config.cache
    

    My environment variables:

    MYSQLDIR=/usr/local/Cellar/mariadb/10.5.8
    QTDIR=/Users/sy/Qt/5.15.2
    QTDIRBIN=/Users/sy/Qt/5.15.2/clang_64/bin
    

    Start the build process:

    $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.5.8/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.5.8/lib" MYSQL_LIBS="-lmariadb"
    

    Then run:

    make
    

    Wait for it to complete:

    make install
    

    Review config.log:

    cat config.log
    

    The log contains:

    > Project WARNING: Qt has only been tested with version 10.15 of the platform SDK, you're using 11.1.
    > Project WARNING: This is an unsupported configuration. You may experience build issues, and by using
    > Project WARNING: the 11.1 SDK you are opting in to new features that Qt has not been prepared for.
    > Project WARNING: Please downgrade the SDK you use to build your app to version 10.15, or configure
    > Project WARNING: with CONFIG+=sdk_no_version_check when running qmake to silence this warning.
    + cd /Users/sy/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds && MAKEFLAGS= make clean && MAKEFLAGS= make
    

    Where do I put CONFIG+=sdk_no_version_check ?
    I've added this to all the .pro files I could find from the sqldrivers folder:

    sqldrivers.pro
    mysql/mysql.pro
    

    Also I have:

    > main.cpp:2:10: fatal error: 'sybfront.h' file not found
    > #include <sybfront.h>
    
    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @SPlatten Google says sybfront.h belongs to freetds. So, I guess you need to install freetds first.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    SPlattenS 1 Reply Last reply
    0
    • jsulmJ jsulm

      @SPlatten Google says sybfront.h belongs to freetds. So, I guess you need to install freetds first.

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #3

      @jsulm , I have already the last time I built a database driver for an earlier version of Qt:

      brew info freetds
      freetds: stable 1.2.18 (bottled), HEAD
      Libraries to talk to Microsoft SQL Server and Sybase databases
      https://www.freetds.org/
      /usr/local/Cellar/freetds/1.2.17 (1,259 files, 13.8MB) *
        Poured from bottle on 2020-12-17 at 10:59:11
      From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/freetds.rb
      License: LGPL-2.0-or-later
      ==> Dependencies
      Build: pkg-config ✔
      Required: openssl@1.1 ✔, unixodbc ✔
      ==> Options
      --HEAD
      	Install HEAD version
      ==> Analytics
      install: 65,640 (30 days), 275,256 (90 days), 868,455 (365 days)
      install-on-request: 12,025 (30 days), 48,740 (90 days), 118,945 (365 days)
      build-error: 0 (30 days)
      

      Kind Regards,
      Sy

      jsulmJ 1 Reply Last reply
      0
      • SPlattenS SPlatten

        @jsulm , I have already the last time I built a database driver for an earlier version of Qt:

        brew info freetds
        freetds: stable 1.2.18 (bottled), HEAD
        Libraries to talk to Microsoft SQL Server and Sybase databases
        https://www.freetds.org/
        /usr/local/Cellar/freetds/1.2.17 (1,259 files, 13.8MB) *
          Poured from bottle on 2020-12-17 at 10:59:11
        From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/freetds.rb
        License: LGPL-2.0-or-later
        ==> Dependencies
        Build: pkg-config ✔
        Required: openssl@1.1 ✔, unixodbc ✔
        ==> Options
        --HEAD
        	Install HEAD version
        ==> Analytics
        install: 65,640 (30 days), 275,256 (90 days), 868,455 (365 days)
        install-on-request: 12,025 (30 days), 48,740 (90 days), 118,945 (365 days)
        build-error: 0 (30 days)
        
        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @SPlatten So, do you have sybfront.h somewhere?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        SPlattenS 1 Reply Last reply
        0
        • jsulmJ jsulm

          @SPlatten So, do you have sybfront.h somewhere?

          SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on last edited by
          #5

          @jsulm , yes, this is exactly the path I went down when I got the message:

          find / -name sybfront.h
          /usr/local/include/sybfront.h
          /usr/local/Cellar/freetds/1.2.17/include/sybfront.h
          

          Kind Regards,
          Sy

          jsulmJ 1 Reply Last reply
          0
          • SPlattenS SPlatten

            @jsulm , yes, this is exactly the path I went down when I got the message:

            find / -name sybfront.h
            /usr/local/include/sybfront.h
            /usr/local/Cellar/freetds/1.2.17/include/sybfront.h
            
            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @SPlatten said in macOS Big Sur and Database driver:

            /usr/local/include

            This include directory is not checked by default when building. You will need to add it as additional include directory. And the dir containing the actual lib also needs to be added as additional libs dir.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            SPlattenS 1 Reply Last reply
            1
            • jsulmJ jsulm

              @SPlatten said in macOS Big Sur and Database driver:

              /usr/local/include

              This include directory is not checked by default when building. You will need to add it as additional include directory. And the dir containing the actual lib also needs to be added as additional libs dir.

              SPlattenS Offline
              SPlattenS Offline
              SPlatten
              wrote on last edited by SPlatten
              #7

              @jsulm , I think that's a symbolic link.

              ls -la sybfront.h
              lrwxr-xr-x  1 sy  admin  43 17 Dec 10:59 sybfront.h -> ../Cellar/freetds/1.2.17/include/sybfront.h
              

              Kind Regards,
              Sy

              jsulmJ 1 Reply Last reply
              0
              • SPlattenS SPlatten

                @jsulm , I think that's a symbolic link.

                ls -la sybfront.h
                lrwxr-xr-x  1 sy  admin  43 17 Dec 10:59 sybfront.h -> ../Cellar/freetds/1.2.17/include/sybfront.h
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @SPlatten Doesn't matter. You have to tell the compiler where to look for the headers (and the linker where to look for the libs) if those are not in system include dirs.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                SPlattenS 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @SPlatten Doesn't matter. You have to tell the compiler where to look for the headers (and the linker where to look for the libs) if those are not in system include dirs.

                  SPlattenS Offline
                  SPlattenS Offline
                  SPlatten
                  wrote on last edited by
                  #9

                  @jsulm thank you, I know how to do this on a PC, how do I do that on a MAC?

                  Kind Regards,
                  Sy

                  jsulmJ 1 Reply Last reply
                  0
                  • SPlattenS SPlatten

                    @jsulm thank you, I know how to do this on a PC, how do I do that on a MAC?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @SPlatten Should be the same on MAC (is a UNIX)

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    SPlattenS 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @SPlatten Should be the same on MAC (is a UNIX)

                      SPlattenS Offline
                      SPlattenS Offline
                      SPlatten
                      wrote on last edited by
                      #11

                      @jsulm , I'm trying to add the library to the project, by selecting the Add Library... option from the project context menu, but I cannot or don't know how to navigate to the path as /usr/local doesn't appear to be available.

                      Kind Regards,
                      Sy

                      jsulmJ 1 Reply Last reply
                      0
                      • SPlattenS SPlatten

                        @jsulm , I'm trying to add the library to the project, by selecting the Add Library... option from the project context menu, but I cannot or don't know how to navigate to the path as /usr/local doesn't appear to be available.

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @SPlatten said in macOS Big Sur and Database driver:

                        Add Library...

                        ?
                        Aren't you building MySQL driver on the command line? How is "Add Library..." related to this?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        SPlattenS 2 Replies Last reply
                        0
                        • jsulmJ jsulm

                          @SPlatten said in macOS Big Sur and Database driver:

                          Add Library...

                          ?
                          Aren't you building MySQL driver on the command line? How is "Add Library..." related to this?

                          SPlattenS Offline
                          SPlattenS Offline
                          SPlatten
                          wrote on last edited by
                          #13

                          @jsulm , yes, sorry, you are quite correct.

                          Kind Regards,
                          Sy

                          1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @SPlatten said in macOS Big Sur and Database driver:

                            Add Library...

                            ?
                            Aren't you building MySQL driver on the command line? How is "Add Library..." related to this?

                            SPlattenS Offline
                            SPlattenS Offline
                            SPlatten
                            wrote on last edited by
                            #14

                            @jsulm , I added:

                            INCLUDEPATH += /usr/local/include
                            

                            To sqldrivers.pro and removed all the config:

                            rm -R config.*
                            

                            Then ran:

                            $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.5.8/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.5.8/lib" MYSQL_LIBS="-lmariadb"
                            make
                            make install
                            

                            config.log still shows:

                            > main.cpp:2:10: fatal error: 'sybfront.h' file not found
                            > #include <sybfront.h>
                            >          ^~~~~~~~~~~~
                            > 1 error generated.
                            > make: *** [main.o] Error 1
                             => source failed verification.
                            test config.sqldrivers.libraries.tds FAILED
                            

                            Kind Regards,
                            Sy

                            jsulmJ 1 Reply Last reply
                            0
                            • SPlattenS SPlatten

                              @jsulm , I added:

                              INCLUDEPATH += /usr/local/include
                              

                              To sqldrivers.pro and removed all the config:

                              rm -R config.*
                              

                              Then ran:

                              $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.5.8/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.5.8/lib" MYSQL_LIBS="-lmariadb"
                              make
                              make install
                              

                              config.log still shows:

                              > main.cpp:2:10: fatal error: 'sybfront.h' file not found
                              > #include <sybfront.h>
                              >          ^~~~~~~~~~~~
                              > 1 error generated.
                              > make: *** [main.o] Error 1
                               => source failed verification.
                              test config.sqldrivers.libraries.tds FAILED
                              
                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #15

                              @SPlatten From a clean state (no build artefacts from previous attempt)?

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              SPlattenS 1 Reply Last reply
                              0
                              • jsulmJ jsulm

                                @SPlatten From a clean state (no build artefacts from previous attempt)?

                                SPlattenS Offline
                                SPlattenS Offline
                                SPlatten
                                wrote on last edited by
                                #16

                                @jsulm , can you elaborate please?

                                Kind Regards,
                                Sy

                                jsulmJ 1 Reply Last reply
                                0
                                • SPlattenS SPlatten

                                  @jsulm , can you elaborate please?

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #17

                                  @SPlatten You already tried to build before, right? That means there are build artefacts (like object files, Makefile, ...). You should make sure you delete all these build artefacts before trying again...
                                  Even better are out-of-source builds (create a build folder, go there and call qmake from there).

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  SPlattenS 1 Reply Last reply
                                  0
                                  • jsulmJ jsulm

                                    @SPlatten You already tried to build before, right? That means there are build artefacts (like object files, Makefile, ...). You should make sure you delete all these build artefacts before trying again...
                                    Even better are out-of-source builds (create a build folder, go there and call qmake from there).

                                    SPlattenS Offline
                                    SPlattenS Offline
                                    SPlatten
                                    wrote on last edited by
                                    #18

                                    @jsulm I just did:

                                    make clean
                                    

                                    From:

                                    /Users/sy/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers
                                    

                                    Result was:

                                    rm -f .moc/moc_predefs.h
                                    rm -f .moc/moc_qsql_mysql_p.cpp
                                    rm -f .moc/main.moc
                                    rm -f .obj/qsql_mysql.o .obj/main.o .obj/moc_qsql_mysql_p.o
                                    rm -f *~ core *.core
                                    cd sqlite/ && ( test -e Makefile || /Users/sy/Qt/5.15.2/clang_64/bin/qmake -o Makefile /Users/sy/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers/sqlite/sqlite.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile clean
                                    rm -f .moc/moc_predefs.h
                                    rm -f .moc/moc_qsql_sqlite_p.cpp
                                    rm -f .moc/smain.moc
                                    rm -f .obj/qsql_sqlite.o .obj/smain.o .obj/sqlite3.o .obj/moc_qsql_sqlite_p.o
                                    rm -f *~ core *.core
                                    

                                    Then rerun:

                                    $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.5.8/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.5.8/lib" MYSQL_LIBS="-lmariadb"
                                    make
                                    make install
                                    

                                    And waited for build to finish. Same result, log file still reports:

                                    > Project WARNING: Qt has only been tested with version 10.15 of the platform SDK, you're using 11.1.
                                    > Project WARNING: This is an unsupported configuration. You may experience build issues, and by using
                                    > Project WARNING: the 11.1 SDK you are opting in to new features that Qt has not been prepared for.
                                    > Project WARNING: Please downgrade the SDK you use to build your app to version 10.15, or configure
                                    > Project WARNING: with CONFIG+=sdk_no_version_check when running qmake to silence this warning.
                                    + cd /Users/sy/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds && MAKEFLAGS= make
                                    > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -w -fPIC  -I. -I/usr/local/opt/openssl/include -I/Users/sy/Qt/5.15.2/clang_64/mkspecs/macx-clang -o main.o main.cpp
                                    > main.cpp:2:10: fatal error: 'sybfront.h' file not found
                                    > #include <sybfront.h>
                                    >          ^~~~~~~~~~~~
                                    > 1 error generated.
                                    > make: *** [main.o] Error 1
                                     => source failed verification.
                                    test config.sqldrivers.libraries.tds FAILED
                                    

                                    Kind Regards,
                                    Sy

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • SPlattenS SPlatten

                                      @jsulm I just did:

                                      make clean
                                      

                                      From:

                                      /Users/sy/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers
                                      

                                      Result was:

                                      rm -f .moc/moc_predefs.h
                                      rm -f .moc/moc_qsql_mysql_p.cpp
                                      rm -f .moc/main.moc
                                      rm -f .obj/qsql_mysql.o .obj/main.o .obj/moc_qsql_mysql_p.o
                                      rm -f *~ core *.core
                                      cd sqlite/ && ( test -e Makefile || /Users/sy/Qt/5.15.2/clang_64/bin/qmake -o Makefile /Users/sy/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers/sqlite/sqlite.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile clean
                                      rm -f .moc/moc_predefs.h
                                      rm -f .moc/moc_qsql_sqlite_p.cpp
                                      rm -f .moc/smain.moc
                                      rm -f .obj/qsql_sqlite.o .obj/smain.o .obj/sqlite3.o .obj/moc_qsql_sqlite_p.o
                                      rm -f *~ core *.core
                                      

                                      Then rerun:

                                      $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.5.8/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.5.8/lib" MYSQL_LIBS="-lmariadb"
                                      make
                                      make install
                                      

                                      And waited for build to finish. Same result, log file still reports:

                                      > Project WARNING: Qt has only been tested with version 10.15 of the platform SDK, you're using 11.1.
                                      > Project WARNING: This is an unsupported configuration. You may experience build issues, and by using
                                      > Project WARNING: the 11.1 SDK you are opting in to new features that Qt has not been prepared for.
                                      > Project WARNING: Please downgrade the SDK you use to build your app to version 10.15, or configure
                                      > Project WARNING: with CONFIG+=sdk_no_version_check when running qmake to silence this warning.
                                      + cd /Users/sy/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds && MAKEFLAGS= make
                                      > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -w -fPIC  -I. -I/usr/local/opt/openssl/include -I/Users/sy/Qt/5.15.2/clang_64/mkspecs/macx-clang -o main.o main.cpp
                                      > main.cpp:2:10: fatal error: 'sybfront.h' file not found
                                      > #include <sybfront.h>
                                      >          ^~~~~~~~~~~~
                                      > 1 error generated.
                                      > make: *** [main.o] Error 1
                                       => source failed verification.
                                      test config.sqldrivers.libraries.tds FAILED
                                      
                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #19

                                      @SPlatten said in macOS Big Sur and Database driver:

                                      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -w -fPIC -I. -I/usr/local/opt/openssl/include -I/Users/sy/Qt/5.15.2/clang_64/mkspecs/macx-clang -o main.o main.cpp

                                      According to this compiler invocation /usr/local/include was not passed as additional include directory...

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      SPlattenS 1 Reply Last reply
                                      0
                                      • jsulmJ jsulm

                                        @SPlatten said in macOS Big Sur and Database driver:

                                        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -w -fPIC -I. -I/usr/local/opt/openssl/include -I/Users/sy/Qt/5.15.2/clang_64/mkspecs/macx-clang -o main.o main.cpp

                                        According to this compiler invocation /usr/local/include was not passed as additional include directory...

                                        SPlattenS Offline
                                        SPlattenS Offline
                                        SPlatten
                                        wrote on last edited by
                                        #20

                                        @jsulm I tried adding another symbolic link to the sqldrivers folder, still same result, where did your output come from?

                                        Kind Regards,
                                        Sy

                                        jsulmJ 2 Replies Last reply
                                        0
                                        • SPlattenS SPlatten

                                          @jsulm I tried adding another symbolic link to the sqldrivers folder, still same result, where did your output come from?

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #21

                                          @SPlatten said in macOS Big Sur and Database driver:

                                          where did your output come from?

                                          It's the output you posted...

                                          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