Hi

I've been trying to get my head around a linking error for a couple of days now. I have a library which has a QMainWindow derived class. The library builds fine, but when I create an instance of the derived class in a simple example program, the linker fails with the error below. I know what this error means, but I don't see how it applies to my situation:

Qt Code:
  1. ../../tmp/actionmanagementexample/main.o: In function `Z5qMainiPPc':
  2. d:\ScinericSoftware\Products\Qtilities\trunk\libraries\ObjManagementLib\examples\ActionManagement/main.cpp:31: undefined reference to `Qtilities::ObjManagement::ExtendedMainWindow::ExtendedMainWindow(QWidget*)'
To copy to clipboard, switch view to plain text mode 

Here is my main program:

Qt Code:
  1. #include <QtGui>
  2. #include <ExtendedMainWindow.h>
  3.  
  4. using namespace Qtilities::ObjManagement;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication a(argc, argv);
  9.  
  10. ExtendedMainWindow* mainWindow = new ExtendedMainWindow(0);
  11. mainWindow->show();
  12.  
  13. return a.exec();
  14. }
To copy to clipboard, switch view to plain text mode 

and my .pro file:

Qt Code:
  1. TARGET = ActionManagement
  2. TEMPLATE = app
  3. SOURCES += main.cpp
  4. LIBS += ../../bin/libObjManagementLib.a
  5. CONFIG += debug
To copy to clipboard, switch view to plain text mode 

And the ExtendedMainWindow class:

Qt Code:
  1. #ifndef OBJMANGEMENTLIBMAINWINDOW_H
  2. #define OBJMANGEMENTLIBMAINWINDOW_H
  3.  
  4. #include <QMainWindow>
  5.  
  6. namespace Ui {
  7. class ExtendedMainWindow;
  8. }
  9.  
  10. namespace Qtilities {
  11. namespace ObjManagement {
  12. struct ExtendedMainWindowData;
  13. class ExtendedMainWindow : public QMainWindow {
  14. Q_OBJECT
  15. public:
  16. ExtendedMainWindow(QWidget *parent = 0);
  17. ~ExtendedMainWindow();
  18.  
  19. protected:
  20. void changeEvent(QEvent *e);
  21.  
  22. private:
  23. Ui::ExtendedMainWindow *ui;
  24. ExtendedMainWindowData* d;
  25. };
  26. }
  27. }
  28.  
  29. #endif // OBJMANGEMENTLIBMAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

And the .cpp implementation of ExtendedMainWindow:

Qt Code:
  1. #include "ExtendedMainWindow.h"
  2. #include "ui_ExtendedMainWindow.h"
  3.  
  4. struct Qtilities::ObjManagement::ExtendedMainWindowData {
  5. ExtendedMainWindowData() { }
  6.  
  7. };
  8.  
  9. Qtilities::ObjManagement::ExtendedMainWindow::ExtendedMainWindow(QWidget *parent) :
  10. QMainWindow(parent),
  11. ui(new Ui::ExtendedMainWindow)
  12. {
  13. ui->setupUi(this);
  14. d = new ExtendedMainWindowData;
  15. }
  16.  
  17. Qtilities::ObjManagement::ExtendedMainWindow::~ExtendedMainWindow()
  18. {
  19. delete ui;
  20. delete d;
  21. }
  22.  
  23. void Qtilities::ObjManagement::ExtendedMainWindow::changeEvent(QEvent *e)
  24. {
  25. QMainWindow::changeEvent(e);
  26. switch (e->type()) {
  27. case QEvent::LanguageChange:
  28. ui->retranslateUi(this);
  29. break;
  30. default:
  31. break;
  32. }
  33. }
To copy to clipboard, switch view to plain text mode 

The UI file is just a plain QMainWindow with nothing on it, called ExtendedMainWindow. I don't understand how the library is able to build (which means that it find the implementation of those functions), but linking against it does not work. Creating wit

Any ideas will be greatly appreciated.

Thanks,
Jaco