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. Set-up MariaDB library file location programmatically?

Set-up MariaDB library file location programmatically?

Scheduled Pinned Locked Moved Solved General and Desktop
85 Posts 7 Posters 34.4k 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.
  • hskoglundH hskoglund

    and ls -la /usr/local/include/mysql/mysql.h ?

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

    @hskoglund

    simonplatten@Simons-iMac sqldrivers % ls -la /usr/local/include/mysql/mysql.h              
    -rw-r--r--  1 simonplatten  staff  41174  9 May 20:28 /usr/local/include/mysql/mysql.h
    

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by
      #60

      Hey, Just in case...
      Did you remove "config.cache" before you run qmake again?

      hskoglundH 1 Reply Last reply
      1
      • B Bonnie

        Hey, Just in case...
        Did you remove "config.cache" before you run qmake again?

        hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #61

        @Bonnie Or I was thinking nuke the whole directory :-)

        1 Reply Last reply
        0
        • SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on last edited by
          #62

          @Bonnie , that looks like its done the trick.

          simonplatten@Simons-iMac sqldrivers % $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.4.13/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.4.13/lib" MYSQL_LIBS="-lmariadb"
          
          Running configuration tests...
          Checking for DB2 (IBM)... no
          Checking for InterBase... no
          Checking for MySQL... yes
          Checking for OCI (Oracle)... no
          Checking for ODBC... no
          Checking for PostgreSQL... no
          Checking for SQLite (version 2)... no
          Checking for TDS (Sybase)... no
          Done running configuration tests.
          
          Configure summary:
          
          Qt Sql Drivers:
            DB2 (IBM) .............................. no
            InterBase .............................. no
            MySql .................................. yes
            OCI (Oracle) ........................... no
            ODBC ................................... no
            PostgreSQL ............................. no
            SQLite2 ................................ no
            SQLite ................................. yes
              Using system provided SQLite ......... no
            TDS (Sybase) ........................... no
          
          Qt is now configured for building. Just run 'make'.
          Once everything is built, you must run 'make install'.
          Qt will be installed into '/Users/simonplatten/Qt/5.14.2/clang_64'.
          
          Prior to reconfiguration, make sure you remove any leftovers from
          the previous build.
          

          Kind Regards,
          Sy

          B 1 Reply Last reply
          0
          • SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #63

            Thank you to everyone for your help, at last now the driver has been created and my application is able to connect to the database.

            Kind Regards,
            Sy

            1 Reply Last reply
            0
            • SPlattenS SPlatten

              @Bonnie , that looks like its done the trick.

              simonplatten@Simons-iMac sqldrivers % $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.4.13/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.4.13/lib" MYSQL_LIBS="-lmariadb"
              
              Running configuration tests...
              Checking for DB2 (IBM)... no
              Checking for InterBase... no
              Checking for MySQL... yes
              Checking for OCI (Oracle)... no
              Checking for ODBC... no
              Checking for PostgreSQL... no
              Checking for SQLite (version 2)... no
              Checking for TDS (Sybase)... no
              Done running configuration tests.
              
              Configure summary:
              
              Qt Sql Drivers:
                DB2 (IBM) .............................. no
                InterBase .............................. no
                MySql .................................. yes
                OCI (Oracle) ........................... no
                ODBC ................................... no
                PostgreSQL ............................. no
                SQLite2 ................................ no
                SQLite ................................. yes
                  Using system provided SQLite ......... no
                TDS (Sybase) ........................... no
              
              Qt is now configured for building. Just run 'make'.
              Once everything is built, you must run 'make install'.
              Qt will be installed into '/Users/simonplatten/Qt/5.14.2/clang_64'.
              
              Prior to reconfiguration, make sure you remove any leftovers from
              the previous build.
              
              B Offline
              B Offline
              Bonnie
              wrote on last edited by Bonnie
              #64

              @SPlatten
              It is actually in the doc:

              If something goes wrong and you want qmake to recheck your available drivers, you must remove config.cache in <QTDIR>/qtbase/src/plugins/sqldrivers - otherwise qmake will not search for the available drivers again.

              I think the doc should make that sentence more sight-catching.
              Many people who had their first qmake command unsuccessful would be stucked there, with a never-changing config.log.

              SPlattenS 1 Reply Last reply
              0
              • B Bonnie

                @SPlatten
                It is actually in the doc:

                If something goes wrong and you want qmake to recheck your available drivers, you must remove config.cache in <QTDIR>/qtbase/src/plugins/sqldrivers - otherwise qmake will not search for the available drivers again.

                I think the doc should make that sentence more sight-catching.
                Many people who had their first qmake command unsuccessful would be stucked there, with a never-changing config.log.

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

                @Bonnie , Hello, I'm trying to rebuild the library again and from my notes:

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

                This results in:

                Usage: /Users/sy/Qt/5.15.1/clang_64/bin/qmake [mode] [options] [files]
                
                QMake has two modes, one mode for generating project files based on
                some heuristics, and the other for generating makefiles. Normally you
                shouldn't need to specify a mode, as makefile generation is the default
                mode for qmake, but you may use this to test qmake on an existing project
                
                Mode:
                  -project       Put qmake into project file generation mode
                                 In this mode qmake interprets [files] as files to
                                 be added to the .pro file. By default, all files with
                                 known source extensions are added.
                                 Note: The created .pro file probably will 
                                 need to be edited. For example add the QT variable to 
                                 specify what modules are required.
                  -makefile      Put qmake into makefile generation mode (default)
                                 In this mode qmake interprets files as project files to
                                 be processed, if skipped qmake will try to find a project
                                 file in your current working directory
                
                Warnings Options:
                  -Wnone         Turn off all warnings; specific ones may be re-enabled by
                                 later -W options
                  -Wall          Turn on all warnings
                  -Wparser       Turn on parser warnings
                  -Wlogic        Turn on logic warnings (on by default)
                  -Wdeprecated   Turn on deprecation warnings (on by default)
                
                Options:
                   * You can place any variable assignment in options and it will be *
                   * processed as if it was in [files]. These assignments will be    *
                   * processed before [files] by default.                            *
                  -o file        Write output to file
                  -d             Increase debug level
                  -t templ       Overrides TEMPLATE as templ
                  -tp prefix     Overrides TEMPLATE so that prefix is prefixed into the value
                  -help          This help
                  -v             Version information
                  -early         All subsequent variable assignments will be
                                 parsed right before default_pre.prf
                  -before        All subsequent variable assignments will be
                                 parsed right before [files] (the default)
                  -after         All subsequent variable assignments will be
                                 parsed after [files]
                  -late          All subsequent variable assignments will be
                                 parsed right after default_post.prf
                  -norecursive   Don't do a recursive search
                  -recursive     Do a recursive search
                  -set <prop> <value> Set persistent property
                  -unset <prop>  Unset persistent property
                  -query <prop>  Query persistent property. Show all if <prop> is empty.
                  -qtconf file   Use file instead of looking for qt.conf
                  -cache file    Use file as cache           [makefile mode only]
                  -spec spec     Use spec as QMAKESPEC       [makefile mode only]
                  -nocache       Don't use a cache file      [makefile mode only]
                  -nodepend      Don't generate dependencies [makefile mode only]
                  -nomoc         Don't generate moc targets  [makefile mode only]
                  -nopwd         Don't look for files in pwd [project mode only]
                

                I've checked $QTDIRBIN, which contains:

                QTDIRBIN=/Users/sy/Qt/5.15.1/clang_64/bin
                

                MariaDB is installed in:

                /usr/local/Cellar/mariadb/10.5.7
                

                Can you help?

                Kind Regards,
                Sy

                jsulmJ 1 Reply Last reply
                0
                • SPlattenS SPlatten

                  @Bonnie , Hello, I'm trying to rebuild the library again and from my notes:

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

                  This results in:

                  Usage: /Users/sy/Qt/5.15.1/clang_64/bin/qmake [mode] [options] [files]
                  
                  QMake has two modes, one mode for generating project files based on
                  some heuristics, and the other for generating makefiles. Normally you
                  shouldn't need to specify a mode, as makefile generation is the default
                  mode for qmake, but you may use this to test qmake on an existing project
                  
                  Mode:
                    -project       Put qmake into project file generation mode
                                   In this mode qmake interprets [files] as files to
                                   be added to the .pro file. By default, all files with
                                   known source extensions are added.
                                   Note: The created .pro file probably will 
                                   need to be edited. For example add the QT variable to 
                                   specify what modules are required.
                    -makefile      Put qmake into makefile generation mode (default)
                                   In this mode qmake interprets files as project files to
                                   be processed, if skipped qmake will try to find a project
                                   file in your current working directory
                  
                  Warnings Options:
                    -Wnone         Turn off all warnings; specific ones may be re-enabled by
                                   later -W options
                    -Wall          Turn on all warnings
                    -Wparser       Turn on parser warnings
                    -Wlogic        Turn on logic warnings (on by default)
                    -Wdeprecated   Turn on deprecation warnings (on by default)
                  
                  Options:
                     * You can place any variable assignment in options and it will be *
                     * processed as if it was in [files]. These assignments will be    *
                     * processed before [files] by default.                            *
                    -o file        Write output to file
                    -d             Increase debug level
                    -t templ       Overrides TEMPLATE as templ
                    -tp prefix     Overrides TEMPLATE so that prefix is prefixed into the value
                    -help          This help
                    -v             Version information
                    -early         All subsequent variable assignments will be
                                   parsed right before default_pre.prf
                    -before        All subsequent variable assignments will be
                                   parsed right before [files] (the default)
                    -after         All subsequent variable assignments will be
                                   parsed after [files]
                    -late          All subsequent variable assignments will be
                                   parsed right after default_post.prf
                    -norecursive   Don't do a recursive search
                    -recursive     Do a recursive search
                    -set <prop> <value> Set persistent property
                    -unset <prop>  Unset persistent property
                    -query <prop>  Query persistent property. Show all if <prop> is empty.
                    -qtconf file   Use file instead of looking for qt.conf
                    -cache file    Use file as cache           [makefile mode only]
                    -spec spec     Use spec as QMAKESPEC       [makefile mode only]
                    -nocache       Don't use a cache file      [makefile mode only]
                    -nodepend      Don't generate dependencies [makefile mode only]
                    -nomoc         Don't generate moc targets  [makefile mode only]
                    -nopwd         Don't look for files in pwd [project mode only]
                  

                  I've checked $QTDIRBIN, which contains:

                  QTDIRBIN=/Users/sy/Qt/5.15.1/clang_64/bin
                  

                  MariaDB is installed in:

                  /usr/local/Cellar/mariadb/10.5.7
                  

                  Can you help?

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

                  @SPlatten In which directory do you call qmake?

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

                  SPlattenS 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @SPlatten In which directory do you call qmake?

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

                    @jsulm, the path of make is specified by the QTDIRBIN environment variable and I've checked the qmake application is in that location.

                    Kind Regards,
                    Sy

                    jsulmJ 1 Reply Last reply
                    0
                    • SPlattenS SPlatten

                      @jsulm, the path of make is specified by the QTDIRBIN environment variable and I've checked the qmake application is in that location.

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

                      @SPlatten said in Set-up MariaDB library file location programmatically?:

                      the path of make is specified by the QTDIRBIN environment variable and I've checked the qmake application is in that location

                      That is not what I asked.
                      In which directory are you when you call qmake?

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

                      SPlattenS 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @SPlatten said in Set-up MariaDB library file location programmatically?:

                        the path of make is specified by the QTDIRBIN environment variable and I've checked the qmake application is in that location

                        That is not what I asked.
                        In which directory are you when you call qmake?

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

                        @jsulm , Ok, thank you, that was part of the problem. I am in:

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

                        The output now is:

                        Running configuration tests...
                        Checking for DB2 (IBM)... no
                        Checking for InterBase... no
                        Checking for MySQL... no
                        Checking for OCI (Oracle)... no
                        Checking for ODBC... no
                        Checking for PostgreSQL... no
                        Checking for SQLite (version 2)... no
                        Checking for TDS (Sybase)... no
                        Done running configuration tests.
                        
                        Configure summary:
                        
                        Qt Sql Drivers:
                          DB2 (IBM) .............................. no
                          InterBase .............................. no
                          MySql .................................. no
                          OCI (Oracle) ........................... no
                          ODBC ................................... no
                          PostgreSQL ............................. no
                          SQLite2 ................................ no
                          SQLite ................................. yes
                            Using system provided SQLite ......... no
                          TDS (Sybase) ........................... no
                        
                        Qt is now configured for building. Just run 'make'.
                        Once everything is built, you must run 'make install'.
                        Qt will be installed into '/Users/sy/Qt/5.15.1/clang_64'.
                        
                        Prior to reconfiguration, make sure you remove any leftovers from
                        the previous build.
                        

                        How do I get MySql set to yes ?

                        I've removed config.cache and re-run qmake, still the same results.

                        Kind Regards,
                        Sy

                        jsulmJ 1 Reply Last reply
                        0
                        • SPlattenS SPlatten

                          @jsulm , Ok, thank you, that was part of the problem. I am in:

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

                          The output now is:

                          Running configuration tests...
                          Checking for DB2 (IBM)... no
                          Checking for InterBase... no
                          Checking for MySQL... no
                          Checking for OCI (Oracle)... no
                          Checking for ODBC... no
                          Checking for PostgreSQL... no
                          Checking for SQLite (version 2)... no
                          Checking for TDS (Sybase)... no
                          Done running configuration tests.
                          
                          Configure summary:
                          
                          Qt Sql Drivers:
                            DB2 (IBM) .............................. no
                            InterBase .............................. no
                            MySql .................................. no
                            OCI (Oracle) ........................... no
                            ODBC ................................... no
                            PostgreSQL ............................. no
                            SQLite2 ................................ no
                            SQLite ................................. yes
                              Using system provided SQLite ......... no
                            TDS (Sybase) ........................... no
                          
                          Qt is now configured for building. Just run 'make'.
                          Once everything is built, you must run 'make install'.
                          Qt will be installed into '/Users/sy/Qt/5.15.1/clang_64'.
                          
                          Prior to reconfiguration, make sure you remove any leftovers from
                          the previous build.
                          

                          How do I get MySql set to yes ?

                          I've removed config.cache and re-run qmake, still the same results.

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

                          @SPlatten said in Set-up MariaDB library file location programmatically?:

                          How do I get MySql set to yes ?

                          As always in such a situation: check config.log for failed MySQL test and see what exactly the problem was...

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

                          SPlattenS 1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @SPlatten said in Set-up MariaDB library file location programmatically?:

                            How do I get MySql set to yes ?

                            As always in such a situation: check config.log for failed MySQL test and see what exactly the problem was...

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

                            @jsulm

                            > main.cpp:2:10: fatal error: 'sybfront.h' file not found
                            > #include <sybfront.h>
                            >          ^~~~~~~~~~~~
                            > 1 error generated.
                            > make: *** [main.o] Error 1
                            

                            Not sure why this is an issue, I have built the driver for a previous version.

                            Kind Regards,
                            Sy

                            jsulmJ 1 Reply Last reply
                            0
                            • SPlattenS SPlatten

                              @jsulm

                              > main.cpp:2:10: fatal error: 'sybfront.h' file not found
                              > #include <sybfront.h>
                              >          ^~~~~~~~~~~~
                              > 1 error generated.
                              > make: *** [main.o] Error 1
                              

                              Not sure why this is an issue, I have built the driver for a previous version.

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

                              @SPlatten said in Set-up MariaDB library file location programmatically?:

                              sybfront.h

                              Google says that header file is part of freetds-dev package (on Ubuntu).

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

                              SPlattenS 1 Reply Last reply
                              0
                              • jsulmJ jsulm

                                @SPlatten said in Set-up MariaDB library file location programmatically?:

                                sybfront.h

                                Google says that header file is part of freetds-dev package (on Ubuntu).

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

                                @jsulm , I'll see what I can find.

                                After some googling:

                                brew upgrade freetds
                                

                                Still getting same result tho.

                                Kind Regards,
                                Sy

                                1 Reply Last reply
                                0
                                • SPlattenS Offline
                                  SPlattenS Offline
                                  SPlatten
                                  wrote on last edited by
                                  #74

                                  Can anyone offer a solution?

                                  Kind Regards,
                                  Sy

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

                                    Since you want to build the MariaDB backend, what does the checks related to that backend say ?

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

                                    SPlattenS 1 Reply Last reply
                                    0
                                    • SGaistS SGaist

                                      Since you want to build the MariaDB backend, what does the checks related to that backend say ?

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

                                      @SGaist , can you explain what you mean please? This is the content of the config.log:

                                      Command line: MYSQL_INCDIR=/usr/local/Cellar/mariadb/10.5.7/include/mysql MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.5.7/lib MYSQL_LIBS=-lmariadb
                                      Global lib dirs: [] [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib]
                                      Global inc dirs: [/usr/local/opt/openssl/include] [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include]
                                      looking for library db2
                                      Trying source 0 (type inline) of library db2 ...
                                        => source failed condition 'config.win32'.
                                      Trying source 1 (type inline) of library db2 ...
                                      sqlcli.h not found in [] and global paths.
                                      sqlcli1.h not found in [] and global paths.
                                        => source produced no result.
                                      test config.sqldrivers.libraries.db2 FAILED
                                      looking for library ibase
                                      Trying source 0 (type inline) of library ibase ...
                                        => source failed condition 'config.win32'.
                                      Trying source 1 (type inline) of library ibase ...
                                      ibase.h not found in [] and global paths.
                                      

                                      I've no idea why there is mention of win32, I'm on an iMAC running:

                                      macOS Big Sur
                                      Version 11.1
                                      

                                      Kind Regards,
                                      Sy

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

                                        If you take the time to read what you just posted, you'll see that it's for the Db2 database.

                                        The logs contain all the tests that are done, concentrate on the one that are pertinent to MariaDB.

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

                                        SPlattenS 1 Reply Last reply
                                        1
                                        • SGaistS SGaist

                                          If you take the time to read what you just posted, you'll see that it's for the Db2 database.

                                          The logs contain all the tests that are done, concentrate on the one that are pertinent to MariaDB.

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

                                          @SGaist , that's the problem isn't it? MySQL isn't mentioned.

                                          Kind Regards,
                                          Sy

                                          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