Hello all...

I've been staring at this for over an hour and I've got to admit... I'm about out of ideas.

I have a plugin (using the low-level approach) that QPluginLoader returns a NULL pointer on when instance() is called. This tends to tell me that (a) The plugin is not being built as a plugin, (b) Qt is not recognizing some name somewhere, or (c) I'm just losing my mind.

I have several other *kinds* of plugins, all of which work perfectly. This is the only plugin of its kind, so it's possible that the plugin interface is borked.

Anyways, each plugin inherits from a master plugin interface (combines common functionality into a single class which all other plugins inherit from):
Qt Code:
  1. class evilcpcPlugin
  2. {
  3. public:
  4. virtual ~evilcpcPlugin(){}
  5.  
  6. /** Returns a short, descriptive name for this plugin*/
  7. virtual const QString getName()const = 0;
  8. /** Returns a longer description for this plugin*/
  9. virtual const QString getDescription()const = 0;
  10. /** Returns the name of the author of this plugin*/
  11. virtual const QString getAuthor()const = 0;
  12. /** Checks whether or not this plugin has encountered an error*/
  13. virtual const bool isValid()const = 0;
  14. /** Returns the nature of an error if this plugin is marked as invalid*/
  15. virtual const QString errorString()const = 0;
  16. /** This will return an instance of the configuration dialog for this
  17.   * plugin. Return a 0 if you need no configuration*/
  18. virtual evilcpcPluginWidgetConfig * getConfigWidget(QWidget * parent) = 0;
  19. /** This will return an instance of the carPC-side daemon utilized for
  20.   * remote configuration of this plugin. Return a 0 if your plugin needs
  21.   * no configuration*/
  22. virtual evilcpcPluginWidgetConfigDaemon * getConfigWidgetDaemon(QWidget * parent) = 0;
  23. };
To copy to clipboard, switch view to plain text mode 
This base class works fine with other plugin types. The actual interface class is this:
Qt Code:
  1. # include <QtPlugin>
  2. # include <evilcpcPlugin.h>
  3.  
  4. class QWidget;
  5. class evilcpcMixerWidget;
  6.  
  7. /** This interface fills the purpose of describing and creating a given mixer
  8.  * plugin */
  9. class evilcpcMixer : public evilcpcPlugin
  10. {
  11. public:
  12. virtual ~evilcpcMixer(){}
  13.  
  14. /** Creates an widget for the mixer plugin to use. This widget will
  15.   * handle control of all audio mixer properties. This will stay
  16.   * resident at all times.
  17.   * @parent - This will be a pointer to the menu plugin's widget*/
  18. virtual evilcpcMixerWidget * getWidget(QWidget * parent) = 0;
  19. };
  20.  
  21. Q_DECLARE_INTERFACE(evilcpcMixer,
  22. "com.warfaresdl.evilcpc.evilcpcMixer/1.0.0")
To copy to clipboard, switch view to plain text mode 
Pretty simple stuff... I can't imagine there's anything screwy here. Then there's the plugin class, which fills in all the pure virtuals:
Qt Code:
  1. # include <evilcpcMixer.h>
  2. # include <QObject>
  3.  
  4. class evilcpcMixerOSS : public QObject, public evilcpcMixer
  5. {
  6. Q_OBJECT
  7. Q_INTERFACES(evilcpcMixer)
  8. public:
  9. evilcpcMixerOSS(QObject * parent = 0);
  10. virtual ~evilcpcMixerOSS();
  11.  
  12. virtual const QString getName()const{return tr("OSSv3 mixer");}
  13. virtual const QString getDescription()const{return tr("Mixer plugin utilizing the OSS v3 library");}
  14. virtual const QString getAuthor()const{return "Richard F. Ostrow Jr.";}
  15. virtual const bool isValid()const{return valid;}
  16. virtual const QString errorString()const{return error;}
  17. virtual evilcpcMixerWidget * getWidget(QWidget * parent);
  18. virtual evilcpcPluginWidgetConfig * getConfigWidget(QWidget * parent);
  19. virtual evilcpcPluginWidgetConfigDaemon * getConfigWidgetDaemon(QWidget * parent);
  20. protected:
  21. QString error;
  22. bool valid;
  23. evilcpcMixerWidget * w;
  24. evilcpcPluginWidgetConfig * cw;
  25. evilcpcPluginWidgetConfigDaemon * cwd;
  26. };
To copy to clipboard, switch view to plain text mode 
Again, pretty simple. And the implementation also contains the Q_EXPORT_PLUGIN2 line, as follows:
Qt Code:
  1. Q_EXPORT_PLUGIN2(LIBTARGET, evilcpcMixerOSS)
To copy to clipboard, switch view to plain text mode 
LIBTARGET is defined in the end of the project file:
Qt Code:
  1. TEMPLATE = lib
  2. HEADERS += evilcpcMixerOSS.h \
  3. evilcpcMixerOSSWidget.h \
  4. evilcpcMixerOSSWidgetConfig.h \
  5. evilcpcMixerOSSWidgetConfigDaemon.h \
  6. ../interface/evilcpcMixer.h \
  7. ../interface/evilcpcMixerWidget.h \
  8. ../../interface/evilcpcPluginWidgetConfig.h \
  9. ../../interface/evilcpcPluginWidgetConfigDaemon.h \
  10. ../../interface/evilcpcPlugin.h
  11. SOURCES += evilcpcMixerOSS.cpp \
  12. evilcpcMixerOSSWidget.cpp \
  13. evilcpcMixerOSSWidgetConfig.cpp \
  14. evilcpcMixerOSSWidgetConfigDaemon.cpp
  15. FORMS += formOSSMixer.ui \
  16. formOSSMixerConfig.ui
  17. RESOURCES += ossmixer.qrc
  18. VERSION = 1.0.0
  19. CONFIG += plugin debug_and_release qt resources
  20. QT += core gui
  21. INCLUDEPATH = ../interface ../../interface
  22.  
  23. CONFIG(debug, debug|release) {
  24. TARGET = evilcpcMixerOSS_debug
  25. DEFINES += LIBTARGET=evilcpcMixerOSS_debug
  26. } else {
  27. TARGET = evilcpcMixerOSS
  28. DEFINES += LIBTARGET=evilcpcMixerOSS
  29. }
To copy to clipboard, switch view to plain text mode 
I went to the trouble of making sure that each interface was included in the HEADERS line of the project file, used the lib template, and added plugin to the CONFIG line. What could I possibly be missing?