Problem to make MySql driver in Qt 5.4
-
make Output like this
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -DQT_NO_MTDEV -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/home/shinigami/Qt/5.4/Src/qtbase/mkspecs/linux-g++-64 -I/home/shinigami/Qt/5.4/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/include/mysql -I/usr/include/qt5/QtSql/5.2.1 -I/usr/include/qt5/QtSql/5.2.1/QtSql -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtCore/5.2.1 -I/usr/include/qt5/QtCore/5.2.1/QtCore -I/usr/include/qt5/QtCore -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -I/usr/include/c++/4.8/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include main.cpp -o .moc/main.moc
g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -I/usr/include/mysql -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I/usr/include/mysql -I/usr/include/qt5/QtSql/5.2.1 -I/usr/include/qt5/QtSql/5.2.1/QtSql -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtCore/5.2.1 -I/usr/include/qt5/QtCore/5.2.1/QtCore -I/usr/include/qt5/QtCore -I.moc -o .obj/main.o main.cpp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -DQT_NO_MTDEV -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/home/shinigami/Qt/5.4/Src/qtbase/mkspecs/linux-g++-64 -I/home/shinigami/Qt/5.4/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/include/mysql -I/usr/include/qt5/QtSql/5.2.1 -I/usr/include/qt5/QtSql/5.2.1/QtSql -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtCore/5.2.1 -I/usr/include/qt5/QtCore/5.2.1/QtCore -I/usr/include/qt5/QtCore -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -I/usr/include/c++/4.8/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include ../../../sql/drivers/mysql/qsql_mysql.cpp -o .moc/qsql_mysql.moc
g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -I/usr/include/mysql -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I/usr/include/mysql -I/usr/include/qt5/QtSql/5.2.1 -I/usr/include/qt5/QtSql/5.2.1/QtSql -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtCore/5.2.1 -I/usr/include/qt5/QtCore/5.2.1/QtCore -I/usr/include/qt5/QtCore -I.moc -o .obj/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp
In file included from /home/shinigami/Qt/5.4/Src/qtbase/include/QtSql/5.4.2/QtSql/private/qsqldriver_p.h:1:0,
from ../../../sql/drivers/mysql/qsql_mysql.cpp:36:
/home/shinigami/Qt/5.4/Src/qtbase/include/QtSql/5.4.2/QtSql/private/../../../../../src/sql/kernel/qsqldriver_p.h:71:5: error: ‘DbmsType’ in ‘class QSqlDriver’ does not name a type
QSqlDriver::DbmsType dbmsType;
^
/home/shinigami/Qt/5.4/Src/qtbase/include/QtSql/5.4.2/QtSql/private/../../../../../src/sql/kernel/qsqldriver_p.h: In constructor ‘QSqlDriverPrivate::QSqlDriverPrivate()’:
/home/shinigami/Qt/5.4/Src/qtbase/include/QtSql/5.4.2/QtSql/private/../../../../../src/sql/kernel/qsqldriver_p.h:64:9: error: class ‘QSqlDriverPrivate’ does not have any field named ‘dbmsType’
dbmsType(QSqlDriver::UnknownDbms)
^
/home/shinigami/Qt/5.4/Src/qtbase/include/QtSql/5.4.2/QtSql/private/../../../../../src/sql/kernel/qsqldriver_p.h:64:18: error: ‘UnknownDbms’ is not a member of ‘QSqlDriver’
dbmsType(QSqlDriver::UnknownDbms)
^
../../../sql/drivers/mysql/qsql_mysql.cpp: In constructor ‘QMYSQLDriverPrivate::QMYSQLDriverPrivate()’:
../../../sql/drivers/mysql/qsql_mysql.cpp:81:40: error: ‘dbmsType’ was not declared in this scope
preparedQuerysEnabled(false) { dbmsType = QSqlDriver::MySqlServer; }
^
../../../sql/drivers/mysql/qsql_mysql.cpp:81:51: error: ‘MySqlServer’ is not a member of ‘QSqlDriver’
preparedQuerysEnabled(false) { dbmsType = QSqlDriver::MySqlServer; }
^
make: *** [.obj/qsql_mysql.o] Error 1I try many things but no solutions Plzzz help :/ & thanks in advance :)
-
What do you have in /home/shinigami/Qt/5.4/? Just the source or a full installation (libs and binaries)? If it's a full installation then you already have the qmake that goes with 5.4. Call qmake with the full path: /home/shinigami/Qt/5.4/..../bin/qmake. The middle part of the path (what I have as ....) will be something like the full version number of Qt (e.g., 5.4.1) and the compiler version, I'm not exactly sure what it is for what you have installed.