So, the typos are fixed and some other things too.

But now I'm having some trouble with an vTable error. And after searching the net for hours and trying over and over again I though it would be time to ask here.

This is a quote from http://www.storkyak.com/2006/07/gnu-...to-vtable.html
GNU C++: Undefined reference to 'vtable for
This is a linker error for GNU. If you get Undefined reference to 'vtable for className, it means that you declared but did not implement a virtual method. In my case, I declared a virtual destructor in the .h, but didn't implement it the .cpp.
So I thought that would be simple, just find the virtual method that I didn't implement in the subclass.
But I can't find it!

I even tried this, I removed OrderAddRecord.h and linked orderAddRecord.cpp to AbstractOrderRecord.h and I removed every virtual function and copied the private variables from orderAddRecord.h into AbstractOrderRecord.h. I changed the constructor in orderAddWindow.cpp.

But that doesn't work neither.

This is AbstractOrderRecord.h
Qt Code:
  1. #ifndef ORDERRECORD_H
  2. #define ORDERRECORD_H
  3.  
  4. #include <QObject>
  5.  
  6. class QDate;
  7. class QString;
  8.  
  9. struct article {
  10. QString description, customization, nr;
  11. int ordered, delivered;
  12. float price;
  13. QDate *warrentyDate;
  14. };
  15.  
  16. class OrderRecord : public QObject
  17. {
  18. Q_OBJECT
  19. public:
  20. //set methods
  21. virtual void setOrderId(const int);
  22. virtual void setCid(const int);
  23. virtual void setDeadline( QDate* );
  24. virtual void setPrepayment(const float);
  25. virtual void setPreviousState(const int);
  26. virtual void setCurrentState(const int);
  27. virtual void addArticle(const QString, const QString, const QString, const float, const int, const int, QDate*);
  28. virtual void addArticle(QList<article>);
  29.  
  30. //accessors
  31. virtual int getOrderId();
  32. virtual int getCid();
  33. virtual QDate getDeadline();
  34. virtual float getPrepayment();
  35. virtual int getPreviousState();
  36. virtual int getCurrentState();
  37. virtual article getArticle(int);
  38.  
  39. };
  40.  
  41. #endif
To copy to clipboard, switch view to plain text mode 

This is orderAddRecord.h
Qt Code:
  1. #ifndef ORDERADDRECORD_H
  2. #define ORDERADDRECORD_H
  3.  
  4. #include "AbstractOrderRecord.h"
  5.  
  6. class QDate;
  7. class QVariant;
  8.  
  9. class OrderAddRecord : public virtual OrderRecord {
  10. Q_OBJECT
  11. public:
  12. OrderAddRecord(QWidget *parent);
  13. void setOrderId(const int);
  14. void setCid(const int);
  15. void setDeadline(QDate*);
  16. void setPrepayment(const float);
  17. void setPreviousState(const int);
  18. void setCurrentState(const int);
  19. void addArticle(const QString, const QString, const QString, const float, const int, const int, QDate*);
  20. void addArticle(const QList<article>);
  21.  
  22. //accessors
  23. int getOrderId();
  24. int getCid();
  25. QDate getDeadline();
  26. float getPrepayment();
  27. int getPreviousState();
  28. int getCurrentState();
  29. article getArticle(int);
  30.  
  31. private:
  32. int orderId;
  33. int cid;
  34. QDate *deadline;
  35. float prepayment;
  36. int previousState;
  37. int currentState;
  38. QList<QVariant> *articles;
  39. };
  40.  
  41. #endif
To copy to clipboard, switch view to plain text mode 

This is orderAddRecord.cpp
Qt Code:
  1. #include "orderAddRecord.h"
  2. #include <QtCore>
  3.  
  4. OrderAddRecord::OrderAddRecord(QWidget *parent)
  5. {
  6. qDebug("OrderAddRecord::OrderAddRecord(): constructing");
  7. }
  8.  
  9.  
  10. void OrderAddRecord::setOrderId(const int orderId)
  11. {
  12. this->orderId = orderId;
  13. }
  14.  
  15. void OrderAddRecord::setCid(const int cid)
  16. {
  17. this->cid = cid;
  18. }
  19.  
  20. void OrderAddRecord::setDeadline(QDate *deadline)
  21. {
  22. this->deadline = deadline;
  23. }
  24.  
  25. void OrderAddRecord::setPrepayment(const float amount)
  26. {
  27. this->prepayment = amount;
  28. }
  29.  
  30. void OrderAddRecord::setPreviousState(const int state)
  31. {
  32. this->previousState = state;
  33. }
  34.  
  35. void OrderAddRecord::setCurrentState(const int state)
  36. {
  37. this->currentState = state;
  38. }
  39.  
  40. void OrderAddRecord::addArticle(QList<article> art)
  41. {
  42. //this->articles << art;
  43. }
  44.  
  45. void OrderAddRecord::addArticle(const QString description, const QString nr, const QString customization, const float price, const int delivered, const int ordered, QDate *warrentyDate)
  46. {
  47.  
  48. article tmpArticle;
  49. tmpArticle.description = description;
  50. tmpArticle.nr = nr;
  51. tmpArticle.customization = customization;
  52. tmpArticle.price = price;
  53. tmpArticle.delivered = delivered;
  54. tmpArticle.ordered = ordered;
  55. tmpArticle.warrentyDate = warrentyDate;
  56.  
  57. //this->articles << tmpArticle;
  58.  
  59. }
  60.  
  61.  
  62. int OrderAddRecord::getCid()
  63. {
  64. return this->cid;
  65. }
  66.  
  67. int OrderAddRecord::getOrderId()
  68. {
  69. return this->orderId;
  70. }
  71.  
  72. QDate OrderAddRecord::getDeadline()
  73. {
  74. // return this->deadline;
  75. }
  76.  
  77. float OrderAddRecord::getPrepayment()
  78. {
  79. return this->prepayment;
  80. }
  81.  
  82. int OrderAddRecord::getPreviousState()
  83. {
  84. return this->previousState;
  85. }
  86.  
  87. int OrderAddRecord::getCurrentState()
  88. {
  89. return this->currentState;
  90. }
  91.  
  92. article OrderAddRecord::getArticle(int index)
  93. {
  94.  
  95. }
To copy to clipboard, switch view to plain text mode 

This is a piece of orderAddWindow.cpp
Qt Code:
  1. OrderRecord *record = new OrderAddRecord(this);
To copy to clipboard, switch view to plain text mode 
I tried this too.
Qt Code:
  1. OrderAddRecord *record = new OrderAddRecord(this);
To copy to clipboard, switch view to plain text mode 

And this is de compiler error:
"vtable for OrderRecord", referenced from:
__ZTV11OrderRecord$non_lazy_ptr in orderAddRecord.o
"vtable for OrderAddRecord", referenced from:
__ZTV14OrderAddRecord$non_lazy_ptr in orderAddRecord.o
Does somebody know how to solve this.
Or where I can read some tutorials to solve this by myself?

Thanks,

Cyberboy

P.S. I'm currently busy with this online book :http://www.icce.rug.nl/documents/cpl...cplusplus.html