undefined symbol while loading plugin
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:
Code:
{
Q_OBJECT
public:
fieldInRowModel
(QObject *parent
=0);
~fieldInRowModel();
private:
};
Implemented as:
Code:
fieldInRowModel
::fieldInRowModel(QObject *parent
){
}
fieldInRowModel::~fieldInRowModel()
{
}
int fieldInRowModel
::rowCount(const QModelIndex &) const {
return 0; //Test value
}
int fieldInRowModel
::columnCount(const QModelIndex &) const {
return 0; //Test value
}
{
}
{
database = db;
}
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.
Code:
undefined symbol: _ZTV15fieldInRowModel
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.
Re: undefined symbol while loading plugin
From plugin you are exposing only interfaces or types known to plugin user (application).
Apparently you are trying to expose from plugin to some application custom type: fieldInRowModel.
Type fieldInRowModel should be visible for application as QAbstractTableModel type, nothing more.
Re: undefined symbol while loading plugin
I guess you might have put your code like that on purpose. Just double check you do aware your code has some problem right? You didn't specify the parameter name in signature of your function definition.
Re: undefined symbol while loading plugin
Hi,
The problem was related to the way I included some header files, so they were exposed to the plugin user.
Thanks.