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. Building Qt with MySQL driver
Forum Updated to NodeBB v4.3 + New Features

Building Qt with MySQL driver

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
mysql driversource
11 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.
  • M Montjet

    Hi,
    I am trying to build Qt 5.11.1 x64 with MySQL driver (Windows).
    Without MySQL it compiles properly, but I got error with MySQL:

    (...)
    qsql_mysql.cpp(235): error C3646: 'nullIndicator': unknown override specifier
    qsql_mysql.cpp(235): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    qsql_mysql.cpp(233): error C2614: 'QMYSQLResultPrivate::QMyField': illegal member initialization: 'nullIndicator' is not a base or member
    qsql_mysql.cpp(233): fatal error C1903: unable to recover from previous error(s); stopping compilation
    (...)
            link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.11 /OUT:..\..\..\..\plugins\platforms\qwindows.dll @C:\Users\ale\AppData\Local\Temp\qwindows.dll.14880.62125.jom
       Creating library ..\..\..\..\plugins\platforms\qwindows.lib and object ..\..\..\..\plugins\platforms\qwindows.exp
            link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.11 /OUT:..\..\..\..\plugins\platforms\qdirect2d.dll @C:\Users\ale\AppData\Local\Temp\qdirect2d.dll.2552.61000.jom
       Creating library ..\..\..\..\plugins\platforms\qdirect2d.lib and object ..\..\..\..\plugins\platforms\qdirect2d.exp
    jom: C:\Qt5.11Sources\5.11.1\Src\qtbase\src\Makefile [sub-plugins-make_first] Error 2
    jom: C:\Qt5.11Sources\5.11.1\Src\qtbase\Makefile [sub-src-make_first] Error 2
    jom: C:\Qt5.11Sources\5.11.1\Src\Makefile [module-qtbase-make_first] Error 2
    

    configure command:

    configure -debug -nomake examples -nomake tests -opensource -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I C:\OpenSSL-Win64\include -L C:\OpenSSL-Win64\lib -sql-mysql -I "C:\Program Files\MySQL\MySQL Server 8.0\include" -L "C:\Program Files\MySQL\MySQL Server 8.0\lib"
    

    Installed package:
    Python 2.7.15
    OpenSSL x64

    and MySQL server 8.0 with Python connector for Python 2.7.
    Please help anybody.

    Compiler: jom

    raven-worxR Offline
    raven-worxR Offline
    raven-worx
    Moderators
    wrote on last edited by
    #2

    @Montjet said in Building Qt with MySQL driver:

    Without MySQL it compiles properly, but I got error with MySQL:
    (...)

    you left out the actual compile error.

    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
    If you have a question please use the forum so others can benefit from the solution in the future

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Montjet
      wrote on last edited by Montjet
      #3

      Ough, you're right.

      qsql_mysql.cpp(235): error C3646: 'nullIndicator': unknown override specifier
      qsql_mysql.cpp(235): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      qsql_mysql.cpp(233): error C2614: 'QMYSQLResultPrivate::QMyField': illegal member initialization: 'nullIndicator' is not a base or member
      qsql_mysql.cpp(233): fatal error C1903: unable to recover from previous error(s); stopping compilation
      

      #edit
      Source:
      alt text

      K raven-worxR 2 Replies Last reply
      0
      • M Montjet

        Ough, you're right.

        qsql_mysql.cpp(235): error C3646: 'nullIndicator': unknown override specifier
        qsql_mysql.cpp(235): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
        qsql_mysql.cpp(233): error C2614: 'QMYSQLResultPrivate::QMyField': illegal member initialization: 'nullIndicator' is not a base or member
        qsql_mysql.cpp(233): fatal error C1903: unable to recover from previous error(s); stopping compilation
        

        #edit
        Source:
        alt text

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #4

        @Montjet

        Which compiler are you using?

        jom is a Qt based substitute for nmake, but may be used also for MinGW. However, it is definitely not a compiler.

        I guess you are trying to use a MSVC compiler when looking at the error code.
        Wondering why you try to compile yourself. 64 bit pre-builds are available for MSVC compilers.
        Are you using an older version of MSVC?

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Montjet
          wrote on last edited by
          #5

          Visual Studio 2017 Community:

          CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
          

          I want to change type of QVariant (from Double to String) for DECIMAL column.

          1 Reply Last reply
          0
          • M Montjet

            Ough, you're right.

            qsql_mysql.cpp(235): error C3646: 'nullIndicator': unknown override specifier
            qsql_mysql.cpp(235): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
            qsql_mysql.cpp(233): error C2614: 'QMYSQLResultPrivate::QMyField': illegal member initialization: 'nullIndicator' is not a base or member
            qsql_mysql.cpp(233): fatal error C1903: unable to recover from previous error(s); stopping compilation
            

            #edit
            Source:
            alt text

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #6

            @Montjet said in Building Qt with MySQL driver:

            qsql_mysql.cpp(235): error C3646: 'nullIndicator': unknown override specifier
            qsql_mysql.cpp(235): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
            qsql_mysql.cpp(233): error C2614: 'QMYSQLResultPrivate::QMyField': illegal member initialization: 'nullIndicator' is not a base or member
            qsql_mysql.cpp(233): fatal error C1903: unable to recover from previous error(s); stopping compilation

            seems your compiler doesn't find the mysql lib?
            Did you specify it?

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Montjet
              wrote on last edited by
              #7

              I just called:

              configure -debug -nomake examples -nomake tests -opensource -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I C:\OpenSSL-Win64\include -L C:\OpenSSL-Win64\lib -sql-mysql -I "C:\Program Files\MySQL\MySQL Server 8.0\include" -L "C:\Program Files\MySQL\MySQL Server 8.0\lib"
              

              Should I do something else?

              raven-worxR 1 Reply Last reply
              0
              • M Montjet

                I just called:

                configure -debug -nomake examples -nomake tests -opensource -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I C:\OpenSSL-Win64\include -L C:\OpenSSL-Win64\lib -sql-mysql -I "C:\Program Files\MySQL\MySQL Server 8.0\include" -L "C:\Program Files\MySQL\MySQL Server 8.0\lib"
                

                Should I do something else?

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #8

                @Montjet
                First make sure that your path (C:\Program Files\MySQL\MySQL Server 8.0) really contains the header, lib and dll files!

                easiest would be to add the following line to the .pro file of the mysql plugin:

                LIBS+=-LC:/path/to/mySQL/lib -lmysql
                

                Or alternatively (since you are using MSVC), do the following in your command line window/script:

                CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
                SET INCLUDE=C:\path\to\mySQL\include;%INCLUDE%
                SET LIB=C:\path\to\mySQL\lib\mysql.lib;%LIB%
                
                ==> start building
                

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Montjet
                  wrote on last edited by
                  #9

                  The same error.

                  echo %INCLUDE%:

                  C:\Program Files\MySQL\MySQL Server 8.0\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt;
                  

                  echo %LIB%

                  C:\Program Files\MySQL\MySQL Server 8.0\lib\mysqlclient.lib;C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\um\x64;
                  

                  Instead of mysql.lib I added libmysql.lib and mysqlclient.lib, beacause there is not this file:
                  alt text

                  raven-worxR 1 Reply Last reply
                  0
                  • M Montjet

                    The same error.

                    echo %INCLUDE%:

                    C:\Program Files\MySQL\MySQL Server 8.0\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt;
                    

                    echo %LIB%

                    C:\Program Files\MySQL\MySQL Server 8.0\lib\mysqlclient.lib;C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\um\x64;
                    

                    Instead of mysql.lib I added libmysql.lib and mysqlclient.lib, beacause there is not this file:
                    alt text

                    raven-worxR Offline
                    raven-worxR Offline
                    raven-worx
                    Moderators
                    wrote on last edited by raven-worx
                    #10

                    @Montjet
                    my_bool typedef was removed from 8.0.1 onwards.
                    So you need to downgrade to a previous version.

                    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                    If you have a question please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    1
                    • M Offline
                      M Offline
                      Montjet
                      wrote on last edited by
                      #11

                      Ok, thank You so much.
                      I will try to do it, tomorrow.

                      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