Hi,

I have a plugin library (like the QT plug-and-paint example) that contains a series of QWidgets to enter data.

The interface of the plugin has a pure virtual fuction called QWidget* impMainModules::loadScreen(QString pluginName) that returns a widget bases on a plugin name.

All worked fine until I wanted to create a QtableModel to use in some of the widgets:
Qt Code:
  1. class fieldInRowModel : public QAbstractTableModel
  2. {
  3. Q_OBJECT
  4. public:
  5. fieldInRowModel(QObject *parent=0);
  6. ~fieldInRowModel();
  7.  
  8. int rowCount(const QModelIndex & parent = QModelIndex()) const;
  9. int columnCount(const QModelIndex &parent = QModelIndex()) const;
  10. QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
  11. void setDatabase (QSqlDatabase db);
  12. private:
  13. QSqlDatabase database;
  14.  
  15. };
To copy to clipboard, switch view to plain text mode 

Implemented as:
Qt Code:
  1. fieldInRowModel::fieldInRowModel(QObject *parent)
  2. {
  3.  
  4. }
  5.  
  6. fieldInRowModel::~fieldInRowModel()
  7. {
  8.  
  9. }
  10.  
  11. int fieldInRowModel::rowCount(const QModelIndex &) const
  12. {
  13. return 0; //Test value
  14. }
  15.  
  16. int fieldInRowModel::columnCount(const QModelIndex &) const
  17. {
  18. return 0; //Test value
  19. }
  20. QVariant fieldInRowModel::data(const QModelIndex &/*index*/, int /*role*/) const
  21. {
  22. return QVariant(); //Test value
  23. }
  24. void fieldInRowModel::setDatabase (QSqlDatabase db)
  25. {
  26. database = db;
  27. }
To copy to clipboard, switch view to plain text mode 

fieldInRowModel is in a separate file called moduleclasses.h and cpp that are part of the plugin library project .

Now, with the inclusion of this class in the plugin library, I get the following error when the main application intents to load the plugin.
Qt Code:
  1. undefined symbol: _ZTV15fieldInRowModel
To copy to clipboard, switch view to plain text mode 

fieldInRowModel is internal for the library thus the main application should not know that it exists.

Any idea how to fix it?

Thanks a lot!
Carlos.