[Interest] status_assert() error when compile plugin

Oswaldo F. Filho offox2001 at gmail.com
Fri Nov 15 20:59:50 CET 2013


Hi,

I try to compile a SQL plugin using
*qt-everywhere-opensource-src-5.1.1 *version.
This plugin already compiled and worked with *Qt-4.8.1.*

I had this .pro file in
*"./qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/qldrivers/sqlcipher*"
directory:

TARGET   = qsqlcipher

HEADERS  = ../../../sql/drivers/sqlite/qsql_sqlite.h
SOURCES  = smain.cpp \
           ../../../sql/drivers/sqlite/qsql_sqlite.cpp

!system-sqlite:!contains( LIBS, .*sqlite.* ) {
    CONFIG(release, debug|release):DEFINES *= NDEBUG
    DEFINES     += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
SQLITE_HAS_CODEC
    INCLUDEPATH += include
    LIBS        += -Llib -lsqlite3 -lcrypto
    QMAKE_RPATHDIR += lib
} else {
    LIBS *= $$QT_LFLAGS_SQLITE
    QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
}

include(../qsqldriverbase.pri)


And I had this main.cpp:

#include <QtSql/QSqlDatabase>
#include <qstringlist.h>
#include "../../../sql/kernel/qsqldriverplugin.h"
#include "../../../sql/drivers/sqlite/qsql_sqlite.h"

QT_BEGIN_NAMESPACE

class QSQLCipherDriverPlugin : public QSqlDriverPlugin
{
public:
    QSQLCipherDriverPlugin();

    QSqlDriver* create(const QString &);
    QStringList keys() const;
};

QSQLCipherDriverPlugin::QSQLCipherDriverPlugin()
    : QSqlDriverPlugin()
{
}

QSqlDriver* QSQLCipherDriverPlugin::create(const QString &name)
{
    if (name == QLatin1String("QSQLCIPHER")) {
        QSQLiteDriver* driver = new QSQLiteDriver();
        return driver;
    }
    return 0;
}

QStringList QSQLCipherDriverPlugin::keys() const
{
    QStringList l;
    l  << QLatin1String("QSQLCIPHER");
    return l;
}

Q_EXPORT_STATIC_PLUGIN(QSQLCipherDriverPlugin)
Q_EXPORT_PLUGIN2(qsqlite, QSQLCipherDriverPlugin)

QT_END_NAMESPACE


I tried to compile this and result was:

offilho at station:~/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/sqldrivers/sqlcipher$
make
/home/offilho/Qt5.1.1/5.1.1/gcc/bin/qmake -o Makefile sqlcipher.pro
WARNING: Failure to find: ../../../sql/drivers/sqlite/qsql_sqlite.h
g++ -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x
-fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_LIBUDEV -DNDEBUG
-DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_COMPLETE -DSQLITE_HAS_CODEC
-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++ -I. -Iinclude
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtSql
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtSql/5.1.1
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtSql/5.1.1/QtSql
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtCore
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtCore/5.1.1
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtCore/5.1.1/QtCore
-I.moc/release-shared -o .obj/release-shared/smain.o smain.cpp
*smain.cpp:4:141: fatal error: ../../../sql/drivers/sqlite/qsql_sqlite.h:
No such file or directory*
*compilation terminated.*
*make: *** [.obj/release-shared/smain.o] Error 1*
offilho at station
:~/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/sqldrivers/sqlcipher$


I changed header file from "../../../sql/drivers/sqlite/qsql_sqlite.h" to
"../../../sql/drivers/sqlite/qsql_sqlite_p.h"

I tried to compile again and It has a new error:

offilho at station:~/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/sqldrivers/sqlcipher$
make
/home/offilho/Qt5.1.1/5.1.1/gcc/bin/qmake -o Makefile sqlcipher.pro
g++ -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x
-fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_LIBUDEV -DNDEBUG
-DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_COMPLETE -DSQLITE_HAS_CODEC
-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++ -I. -Iinclude
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtSql
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtSql/5.1.1
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtSql/5.1.1/QtSql
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtCore
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtCore/5.1.1
-I/home/offilho/Qt5.1.1/5.1.1/gcc/include/QtCore/5.1.1/QtCore
-I.moc/release-shared -o .obj/release-shared/smain.o smain.cpp
*smain.cpp:39:1: error: expected constructor, destructor, or type
conversion before ‘static_assert’*
*make: *** [.obj/release-shared/smain.o] Error 1*
offilho at station
:~/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/sqldrivers/sqlcipher$


Please, what is happened?

The problem occurs in Q_EXPORT_PLUGIN2, but where and why?

Thanks.

Oswaldo Fratini Filho.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131115/c380e698/attachment.html>


More information about the Interest mailing list