PDA

View Full Version : error using a plugin



franco.amato
26th July 2010, 23:03
Hi to all,
I'm getting error with qt plugins and visual studio 2005.
This is the code:


#include "LayoutEditor.h"
#include "LoginDialog.h"
#include "OfficesDialog.h"

#include <QtCore/QtPlugin>
#include <QtGui/QtGui>
#include <QtGui/QApplication>
#include <QtGui/QCleanlooksStyle>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QtGui/QMessageBox>
#include <QtCore/QSettings>
#include <QtCore/QFile>
#include "Common.h"

Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qmng)
Q_IMPORT_PLUGIN(qtiff)
Q_IMPORT_PLUGIN(qsqlodbc)

QTextStream g_log;

bool connectToDB()
{
QSettings settings("EditorGrafico.remote.ini", QSettings::IniFormat);
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setHostName(settings.value("db_hostname").toString());
db.setDatabaseName(settings.value("db_name").toString());
db.setUserName(settings.value("db_username").toString());
db.setPassword(settings.value("db_userpass").toString());
return db.open();
}

and this is the error I got:

Error 1 error LNK2019: sÃ*mbolo externo "class QObject * __cdecl qt_plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ) sin resolver al que se hace referencia en la función "public: __thiscall StaticqjpegPluginInstance::StaticqjpegPluginInstan ce(void)" (??0StaticqjpegPluginInstance@@QAE@XZ) main.obj

I work with visual studio 2005 and Qt 4.6.3 without pro file.
I hope to get help.

Best Regards,
Franco

Lykurg
26th July 2010, 23:14
My italian is currently not so good, therefore an english translation of the error message could be useful. But by the way, why you are "including" the jpeg plugin? Qt does this alone and there is no need to do it explicitly.

franco.amato
27th July 2010, 17:21
My italian is currently not so good, therefore an english translation of the error message could be useful. But by the way, why you are "including" the jpeg plugin? Qt does this alone and there is no need to do it explicitly.

Hi Lykurg,
thank you. It's not Italian, it's spanish :-)
Meanwhile where I don't have to include the jpeg plugin?
I didn't get you. I followed a Qt example.

Best Regards,
Franco

Lykurg
27th July 2010, 17:28
did you try to link statically some plugins? If you do, you have set the proper QTPLUGIN in your pro file and make sure you cleaned your project properly before building it static.