Results 1 to 4 of 4

Thread: Creating QMYSQL Driver

  1. #1
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows Symbian S60

    Default Creating QMYSQL Driver

    Dear All,

    Let me just explain. Im creating an app for symbian smartphone using QT that will connect to remote DB (MYSQL) and update the table every certain time with coordinates received from GPS. I'm coming to a problem there is no QMYSQL driver installed thus I can't proceed. Only installed driver is QSQLITE. My question is, could I use QSQLITE driver to update tables ? It seems that using QSQLITE driver I can connect to DB, but can't do anything further (insert data to tables). Is it the QSQLITE that does not allow to insert that data or it could be code ?

    Secondly, I tried to create my own QMYSQL driver as there are many tutorials out there. I was using few of them, but this one takes me the furthest : http://www.dreamincode.net/forums/to...ql-with-mingw/

    I'm getting into a problems when I execute mingw32-make. I get following messages:

    Setting up environment for Qt usage...

    C:\Qt\Qt5.1.0\5.1.0\mingw48_32>set PATH=C:\\QtSDK\\mingw\\bin

    C:\Qt\Qt5.1.0\5.1.0\mingw48_32>set QTDIR=C:\\QtSDK\\QtSources\\4.8.1\\src\\plugi
    ns\\sqldrivers\\mysql

    C:\Qt\Qt5.1.0\5.1.0\mingw48_32>set QMAKESPEC=C:\\Qt\\4.8.5\\mkspecs\\win32-g++

    C:\Qt\Qt5.1.0\5.1.0\mingw48_32>set mysqldir=C:\\MySQL\\MySQLServer55

    C:\Qt\Qt5.1.0\5.1.0\mingw48_32>cd %mysqldir%\\lib

    C:\MySQL\MySQLServer55\lib>reimp -d libmysql.lib

    C:\MySQL\MySQLServer55\lib>dlltool -k -d libmysql.def -l libmysql.a

    C:\MySQL\MySQLServer55\lib>cd %QTDIR%\\src\\plugins\\sqldrivers\\mysql
    System nie moze odnalezc okreslonej sciezki.

    C:\MySQL\MySQLServer55\lib>cd %QTDIR%

    C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql>qmake -o Makefile "INCLUDE
    PATH+=%mysqldir%\\include" "LIBS+=%mysqldir%\\lib\\libmysql.a" mysql.pro

    C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql>mingw32-make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/QtSDK/QtSources/4.8.1/src/plugins/sqldri
    vers/mysql'
    g++ -c -pipe -O2 -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_NO_CAST_
    TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_COR
    E_LIB -DQT_THREAD_SUPPORT -DQT_NO_DYNAMIC_CAST -I"r:\build\libs\qt-4.8.2.2012032
    1\image-msvc2010-RelWithDebInfo-4.8.2\include\QtCore" -I"r:\build\libs\qt-4.8.2.
    20120321\image-msvc2010-RelWithDebInfo-4.8.2\include\QtSql" -I"r:\build\libs\qt-
    4.8.2.20120321\image-msvc2010-RelWithDebInfo-4.8.2\include" -I"c:\MySQL\MySQLSer
    ver55\include" -I"r:\build\libs\qt-4.8.2.20120321\image-msvc2010-RelWithDebInfo-
    4.8.2\include\ActiveQt" -I"release" -I"c:\Qt\4.8.5\mkspecs\win32-g++" -o release
    \main.o main.cpp
    main.cpp:42:30: error: qsqldriverplugin.h: No such file or directory
    main.cpp:43:25: error: qstringlist.h: No such file or directory
    In file included from main.cpp:44:
    ../../../sql/drivers/mysql/qsql_mysql.h:45:30: error: QtSql/qsqldriver.h: No suc
    h file or directory
    ../../../sql/drivers/mysql/qsql_mysql.h:46:30: error: QtSql/qsqlresult.h: No suc
    h file or directory
    In file included from c:\MySQL\MySQLServer55\include/mysql.h:72,
    from ../../../sql/drivers/mysql/qsql_mysql.h:52,
    from main.cpp:44:
    c:\MySQL\MySQLServer55\include/mysql_com.h:291: error: 'SOCKET' does not name a
    type
    c:\MySQL\MySQLServer55\include/mysql_com.h:470: error: 'SOCKET' was not declared
    in this scope
    c:\MySQL\MySQLServer55\include/mysql_com.h:470: error: expected primary-expressi
    on before 'const'
    c:\MySQL\MySQLServer55\include/mysql_com.h:470: error: expected primary-expressi
    on before 'unsigned'
    c:\MySQL\MySQLServer55\include/mysql_com.h:471: error: expected primary-expressi
    on before 'unsigned'
    c:\MySQL\MySQLServer55\include/mysql_com.h:471: error: initializer expression li
    st treated as compound expression
    In file included from main.cpp:44:
    ../../../sql/drivers/mysql/qsql_mysql.h:60: error: 'QT_BEGIN_HEADER' does not na
    me a type
    ../../../sql/drivers/mysql/qsql_mysql.h:70: error: expected class-name before '{
    ' token
    ../../../sql/drivers/mysql/qsql_mysql.h:77: error: 'QVariant' does not name a ty
    pe
    ../../../sql/drivers/mysql/qsql_mysql.h:84: error: 'QVariant' does not name a ty
    pe
    ../../../sql/drivers/mysql/qsql_mysql.h:86: error: ISO C++ forbids declaration o
    f 'QString' with no type
    ../../../sql/drivers/mysql/qsql_mysql.h:86: error: expected ',' or '...' before
    '&' token
    ../../../sql/drivers/mysql/qsql_mysql.h:89: error: 'QVariant' does not name a ty
    pe
    ../../../sql/drivers/mysql/qsql_mysql.h:90: error: 'QSqlRecord' does not name a
    type
    ../../../sql/drivers/mysql/qsql_mysql.h:95: error: ISO C++ forbids declaration o
    f 'QString' with no type
    ../../../sql/drivers/mysql/qsql_mysql.h:95: error: expected ',' or '...' before
    '&' token
    ../../../sql/drivers/mysql/qsql_mysql.h:103: error: expected class-name before '
    {' token
    ../../../sql/drivers/mysql/qsql_mysql.h:104: error: ISO C++ forbids declaration
    of 'Q_OBJECT' with no type
    ../../../sql/drivers/mysql/qsql_mysql.h:105: error: expected ';' before 'friend'

    ../../../sql/drivers/mysql/qsql_mysql.h:107: error: expected ')' before '*' toke
    n
    ../../../sql/drivers/mysql/qsql_mysql.h:108: error: 'QObject' has not been decla
    red
    ../../../sql/drivers/mysql/qsql_mysql.h:110: error: 'DriverFeature' has not been
    declared
    ../../../sql/drivers/mysql/qsql_mysql.h:111: error: ISO C++ forbids declaration
    of 'QString' with no type
    ../../../sql/drivers/mysql/qsql_mysql.h:111: error: expected ',' or '...' before
    '&' token
    ../../../sql/drivers/mysql/qsql_mysql.h:118: error: ISO C++ forbids declaration
    of 'QSqlResult' with no type
    ../../../sql/drivers/mysql/qsql_mysql.h:118: error: expected ';' before '*' toke
    n
    ../../../sql/drivers/mysql/qsql_mysql.h:119: error: 'QStringList' does not name
    a type
    ../../../sql/drivers/mysql/qsql_mysql.h:120: error: 'QSqlIndex' does not name a
    type
    ../../../sql/drivers/mysql/qsql_mysql.h:121: error: 'QSqlRecord' does not name a
    type
    ../../../sql/drivers/mysql/qsql_mysql.h:122: error: 'QString' does not name a ty
    pe
    ../../../sql/drivers/mysql/qsql_mysql.h:124: error: 'QVariant' does not name a t
    ype
    ../../../sql/drivers/mysql/qsql_mysql.h:125: error: 'QString' does not name a ty
    pe
    ../../../sql/drivers/mysql/qsql_mysql.h:127: error: expected ':' before 'Q_SLOTS
    '
    ../../../sql/drivers/mysql/qsql_mysql.h:128: error: expected primary-expression
    before 'bool'
    ../../../sql/drivers/mysql/qsql_mysql.h:128: error: ISO C++ forbids declaration
    of 'Q_SLOTS' with no type
    ../../../sql/drivers/mysql/qsql_mysql.h:128: error: expected ';' before 'bool'
    ../../../sql/drivers/mysql/qsql_mysql.h:136: error: ISO C++ forbids declaration
    of 'QMYSQLDriverPrivate' with no type
    ../../../sql/drivers/mysql/qsql_mysql.h:136: error: expected ';' before '*' toke
    n
    ../../../sql/drivers/mysql/qsql_mysql.h:139: error: 'QT_END_NAMESPACE' does not
    name a type
    main.cpp:57: error: 'QMYSQLDriverPlugin' has not been declared
    main.cpp:57: error: ISO C++ forbids declaration of 'QMYSQLDriverPlugin' with no
    type
    main.cpp: In function 'int QMYSQLDriverPlugin()':
    main.cpp:58: error: only constructors take base initializers
    main.cpp:60: warning: no return statement in function returning non-void
    main.cpp: At global scope:
    main.cpp:62: error: expected constructor, destructor, or type conversion before
    '*' token
    mingw32-make[1]: *** [release/main.o] Error 1
    mingw32-make[1]: Leaving directory `C:/QtSDK/QtSources/4.8.1/src/plugins/sqldriv
    ers/mysql'
    mingw32-make: *** [release] Error 2

    C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql>


    Could please someone help me ?????
    Thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Creating QMYSQL Driver

    My question is, could I use QSQLITE driver to update tables ? It seems that using QSQLITE driver I can connect to DB, but can't do anything further (insert data to tables). Is it the QSQLITE that does not allow to insert that data or it could be code ?
    The Sqlite driver can manipulate Sqlite databases in all the ways you would expect. Sqlite databases are local files. The Sqlite driver cannot do anything with a MySql database whether local or remote.

    You will need to build a MySql Qt plugin for your target platform (Symbian) as well as your desktop environment (if you want to test off-device).

    Please edit your post to put all that machine output between [code] [/code] tags
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  3. #3
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows Symbian S60

    Default Re: Creating QMYSQL Driver

    Hmmm How do you edit posts ? :P

    Also ... I don't need driver for the desktop, it's just the symbian ... Would you know how to do it ?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Creating QMYSQL Driver

    AFAICT Qt5 is not supported on Symbian phones.
    The pre-deployed Qt on Symbian phones is Qt 4.7 (maybe 4.8) and AFAICT does not include a MySql plugin.
    Last edited by ChrisW67; 9th August 2013 at 01:59.

Similar Threads

  1. QMySQL Help! driver will not install
    By crazymonkey in forum Installation and Deployment
    Replies: 3
    Last Post: 27th April 2011, 21:34
  2. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 15:00
  3. QMYSQL driver
    By pcaeiro in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2009, 14:35
  4. QMYSQL driver not loaded
    By sepehr in forum Qt Programming
    Replies: 12
    Last Post: 11th January 2009, 20:15
  5. QMYSQL driver
    By Fastman in forum Installation and Deployment
    Replies: 2
    Last Post: 26th October 2007, 08:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.