Hi all!

I am used to do plugins on ubuntu but now I need to do some on windows and it's just not working.

this code works prefecty on ubuntu: (of couse the destination folder is different)

Loader Class main.cpp
Qt Code:
  1. #include <QtGui>
  2. #include <QtCore>
  3. #include <QApplication>
  4. #include <QMessageBox>
  5.  
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. #include "C:\Dokumente und Einstellungen\itadmin\workspaceTest\LDMS\ILDMS.h"
  10.  
  11. int main(int argc, char *argv[])
  12. {
  13. QApplication a(argc, argv);
  14.  
  15. QPluginLoader loader("C:\esp\plugins\LDMS.dll");
  16.  
  17. QObject *plugin = loader.instance();
  18.  
  19. if(plugin){
  20. QMessageBox msgBox;
  21. msgBox.setText("Loaded");
  22. msgBox.exec();
  23. }else{
  24. QMessageBox msgBox;
  25. msgBox.setText("Not loaded");
  26. msgBox.exec();
  27. }
  28. return a.exec();
  29. }
To copy to clipboard, switch view to plain text mode 

pro file
Qt Code:
  1. TEMPLATE = app
  2. TARGET = GuiLoaderPlugin
  3.  
  4. QT += core \
  5. gui
  6.  
  7. HEADERS +=
  8. SOURCES += main.cpp
  9. FORMS +=
  10. RESOURCES +=
To copy to clipboard, switch view to plain text mode 


Plugin .cpp

Qt Code:
  1. #include "ldms.h"
  2.  
  3. void LDMS::init(){
  4. ui.setupUi(this);
  5. }
To copy to clipboard, switch view to plain text mode 

.h

Qt Code:
  1. #ifndef LDMS_H
  2. #define LDMS_H
  3.  
  4. #include <QtGui/QWidget>
  5. #include "ui_ldms.h"
  6.  
  7. #include "ILDMS.h"
  8.  
  9. class LDMS : public QWidget,
  10. public ILDMS
  11. {
  12. Q_OBJECT
  13. Q_INTERFACES(ILDMS)
  14.  
  15. public:
  16. void init();
  17.  
  18. private:
  19. Ui::LDMSClass ui;
  20. };
  21.  
  22. #endif // LDMS_H
To copy to clipboard, switch view to plain text mode 

interface

Qt Code:
  1. #ifndef ILDMS_H_
  2. #define ILDMS_H_
  3.  
  4. #include <QtCore>
  5.  
  6. class ILDMS {
  7. public:
  8.  
  9. virtual void init() = 0;
  10.  
  11. };
  12.  
  13. Q_DECLARE_INTERFACE(ILDMS,
  14. "esp.ibex/1.0")
  15.  
  16. #endif /* ILDMS_H_ */
To copy to clipboard, switch view to plain text mode 

pro file

Qt Code:
  1. TEMPLATE = lib
  2. CONFIG += plugin
  3. DESTDIR = C:\esp\plugins
  4. TARGET = LDMS
  5. QT += core \
  6. gui
  7. HEADERS += ILDMS.h \
  8. ldms.h
  9. SOURCES += ldms.cpp
  10. FORMS += ldms.ui
  11. RESOURCES +=
To copy to clipboard, switch view to plain text mode 

this works perfectly with ubuntu but on windows I just keep getting "Not loaded" messages.

Thanks in advance!