Building Qt with MySQL driver



  • 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


  • Moderators

    @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.



  • 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


  • Moderators

    @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?



  • 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.


  • Moderators

    @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?



  • 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?


  • Moderators

    @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
    


  • 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


  • Moderators

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



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.