Hi Guys,

I'm running into a problem with a class implementing different interfaces. There is basically 3 libraries: 1 contains the IPlugin interface below, the 2nd contains the IInputParser interface and the third contains the class using these interfaces.

Here is the class and interface definitions. Note that all the SHARED_EXPORT macros are defined in the different libraries as shown below for example:

Qt Code:
  1. #if defined(HDL_AUTHOR_PARSER_LIBRARY)
  2. # define HDL_AUTHOR_PARSER_SHARED_EXPORT Q_DECL_EXPORT
  3. #else
  4. # define HDL_AUTHOR_PARSER_SHARED_EXPORT Q_DECL_IMPORT
  5. #endif
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. class HDL_AUTHOR_PARSER_SHARED_EXPORT HDL_Author_Parser : public IPlugin, public IInputParser
  2. {
  3. Q_OBJECT
  4. Q_INTERFACES(Qtilities::ExtensionSystem::Interfaces::IPlugin)
  5. //Q_INTERFACES(FirmwareCore::Interfaces::IInputParser)
  6.  
  7. public:
  8. HDL_Author_Parser(QObject* parent = 0);
  9. ~HDL_Author_Parser();
  10.  
  11. // --------------------------------------------
  12. // IInputParser Implementation
  13. // --------------------------------------------
  14. DesignManager* parseDesignFromFile(const QString& fileName) const;
  15. QMap<QString,QString> supportedFileTypes() const;
  16.  
  17. // --------------------------------------------
  18. // IPlugin Implementation
  19. // --------------------------------------------
  20. bool initialize(const QStringList &arguments, QString *errorString);
  21. bool initializeDependancies(QString *errorString);
  22. void finalize();
  23. double pluginVersion();
  24. QList<double> pluginCompatibilityVersions();
  25. QString pluginPublisher();
  26. QString pluginPublisherWebsite();
  27. QString pluginPublisherContact();
  28. QString pluginDescription();
  29. QString pluginCopyright();
  30. QString pluginLicense();
  31.  
  32. private:
  33. HDL_Author_ParserData* d;
  34. };
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. class FIRMWARE_CORE_LIBRARY_SHARED_EXPORT IInputParser {
  2. public:
  3. IInputParser() {}
  4. virtual ~IInputParser() {}
  5.  
  6. virtual DesignManager* parseDesignFromFile(const QString& fileName) const = 0;
  7. virtual QMap<QString,QString> supportedFileTypes() const = 0;
  8. };
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. class EXTENSION_SYSTEM_SHARED_EXPORT IPlugin : public QObject
  2. {
  3. Q_OBJECT
  4. Q_ENUMS(PluginState)
  5.  
  6. public:
  7. IPlugin(QObject* parent = 0) : QObject(parent) {}
  8. virtual ~IPlugin() {}
  9.  
  10. enum PluginState { Functional, InitializationError, DependancyError };
  11. void setPluginState(PluginState state) { d_state = state; }
  12. PluginState pluginState() { return d_state; }
  13. void setErrorString(const QString& error_string) { d_error_string = error_string; }.
  14. QString errorString() { return d_error_string; }
  15. virtual bool initialize(const QStringList &arguments, QString *errorString) = 0;
  16. virtual bool initializeDependancies(QString *errorString) = 0;
  17. virtual void finalize() { }
  18. virtual double pluginVersion() = 0;
  19. virtual QList<double> pluginCompatibilityVersions() = 0;
  20. virtual QString pluginPublisher() = 0;
  21. virtual QString pluginPublisherWebsite() = 0;
  22. virtual QString pluginPublisherContact() = 0;
  23. virtual QString pluginDescription() = 0;.
  24. virtual QString pluginCopyright() = 0;
  25. virtual QString pluginLicense() = 0;
  26.  
  27. private:
  28. PluginState d_state;
  29. QString d_error_string;
  30. };
To copy to clipboard, switch view to plain text mode 

Now when I compile this I get linker errors:
Qt Code:
  1. d:/Projects/Qt/FirmwareManagementTool/sources/trunk/build/tmp/HDL_Author_Parser/HDL_Author_Parser.o: In function `IInputParser':
  2. d:/Projects/Qt/FirmwareManagementTool/sources/trunk/libraries/FirmwareCore/sources/IInputParser.h:26: undefined reference to `_imp___ZTVN12FirmwareCore10Interfaces12IInputParserE'
  3. d:/Projects/Qt/FirmwareManagementTool/sources/trunk/build/tmp/HDL_Author_Parser/HDL_Author_Parser.o: In function `~IInputParser':
  4. d:/Projects/Qt/FirmwareManagementTool/sources/trunk/libraries/FirmwareCore/sources/IInputParser.h:27: undefined reference to `_imp___ZTVN12FirmwareCore10Interfaces12IInputParserE'
  5. d:/Projects/Qt/FirmwareManagementTool/sources/trunk/libraries/FirmwareCore/sources/IInputParser.h:27: undefined reference to `_imp___ZTVN12FirmwareCore10Interfaces12IInputParserE'
  6. d:/Projects/Qt/FirmwareManagementTool/sources/trunk/libraries/FirmwareCore/sources/IInputParser.h:27: undefined reference to `_imp___ZTVN12FirmwareCore10Interfaces12IInputParserE'
To copy to clipboard, switch view to plain text mode 

I really don't understand why it does not work and I can't see any problems. When the HDL_Author_Parser class does not inherit from the IInputParser class it is not a problem.

Any help would be appreciated.

Thanks,
Jaco