Results 1 to 4 of 4

Thread: error using a plugin

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    692
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default error using a plugin

    Hi to all,
    I'm getting error with qt plugins and visual studio 2005.
    This is the code:

    Qt Code:
    1. #include "LayoutEditor.h"
    2. #include "LoginDialog.h"
    3. #include "OfficesDialog.h"
    4.  
    5. #include <QtCore/QtPlugin>
    6. #include <QtGui/QtGui>
    7. #include <QtGui/QApplication>
    8. #include <QtGui/QCleanlooksStyle>
    9. #include <QtSql/QSqlDatabase>
    10. #include <QtSql/QSqlQuery>
    11. #include <QtGui/QMessageBox>
    12. #include <QtCore/QSettings>
    13. #include <QtCore/QFile>
    14. #include "Common.h"
    15.  
    16. Q_IMPORT_PLUGIN(qjpeg)
    17. Q_IMPORT_PLUGIN(qgif)
    18. Q_IMPORT_PLUGIN(qmng)
    19. Q_IMPORT_PLUGIN(qtiff)
    20. Q_IMPORT_PLUGIN(qsqlodbc)
    21.  
    22.  
    23. bool connectToDB()
    24. {
    25. QSettings settings("EditorGrafico.remote.ini", QSettings::IniFormat);
    26. QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    27. db.setHostName(settings.value("db_hostname").toString());
    28. db.setDatabaseName(settings.value("db_name").toString());
    29. db.setUserName(settings.value("db_username").toString());
    30. db.setPassword(settings.value("db_userpass").toString());
    31. return db.open();
    32. }
    To copy to clipboard, switch view to plain text mode 

    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
    Franco Amato

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: error using a plugin

    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.

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    692
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: error using a plugin

    Quote Originally Posted by Lykurg View Post
    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
    Franco Amato

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: error using a plugin

    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.

Similar Threads

  1. Error loading plugin dinamically
    By Zero in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2010, 23:31
  2. WinSeven,QSQL plugin,error
    By Fastman in forum Qt Programming
    Replies: 0
    Last Post: 9th May 2009, 20:49
  3. Plugin - DLL error
    By steg90 in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 10:57
  4. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  5. Plugin compiling error
    By hgedek in forum Qt Programming
    Replies: 5
    Last Post: 22nd August 2007, 22:49

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.