Hey all, I have a problem building my application when using a custom widget.
I'm using the custom widget "tictactoe" that came with the examples.

For creating the project files I used the following steps:
  • cd C:\Qt\4.4.2\projects\Test\Test
  • qmake -project
  • qmake -tp vc test.pro
  • Added "C:\Qt\4.4.2\examples\designer\taskmenuextensi on" to the project include list in visual studio.



I'm getting the following link error when building my project:

Error 1 error LNK2019: unresolved external symbol "public: __thiscall TicTacToe::TicTacToe(class QWidget *)" (??0TicTacToe@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_MyTest::setupUi(class QMainWindow *)" (?setupUi@Ui_MyTest@@QAEXPAVQMainWindow@@@Z) mytest.obj

Error 2 fatal error LNK1120: 1 unresolved externals debug\test.exe

Qt Code:
  1. //main.cpp
  2. #include <QApplication>
  3. #include "mytest.h"
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication app(argc, argv);
  8. MyTest mytest;
  9. mytest.show();
  10. return app.exec();
  11. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. //mytest.cpp
  2. #include <QtGui>
  3. #include "mytest.h"
  4.  
  5. MyTest::MyTest(QMainWindow *p_Parent) : QMainWindow(p_Parent)
  6. {
  7. setupUi(this);
  8. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. //mytest.h
  2. #ifndef MYTEST_H
  3. #define MYTEST_H
  4.  
  5. #include "ui_mytest.h"
  6.  
  7. class MyTest : public QMainWindow, private Ui::MyTest
  8. {
  9. Q_OBJECT
  10.  
  11. public:
  12. MyTest(QMainWindow *p_parent = 0);
  13.  
  14. };
  15.  
  16. #endif
To copy to clipboard, switch view to plain text mode 

I only get this error when I use a custom widget. Because when I remove the custom widget from my ui file I can successfully build and run the application.