Arrg... new problem. Stack won't compile. I get this error:
'stack\Stack.h:0: Warning: No relevant classes found. No output generated.
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\Demurr.exe object_script.Demurr.Release -L"f:\Programs\Qt4.6\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain F:/Programs/mapm/libmapm.a -lQtOpenGL4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `G:/Documents/Projects/Demurr2'
mingw32-make: Leaving directory `G:/Documents/Projects/Demurr2'
./release\Stack.o:Stack.cpp:(.text+0x2e0): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x328): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x36c): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x3d4): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x4bc): undefined reference to `vtable for Stack'
collect2: ld returned 1 exit status
'stack\Stack.h:0: Warning: No relevant classes found. No output generated.
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\Demurr.exe object_script.Demurr.Release -L"f:\Programs\Qt4.6\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain F:/Programs/mapm/libmapm.a -lQtOpenGL4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `G:/Documents/Projects/Demurr2'
mingw32-make: Leaving directory `G:/Documents/Projects/Demurr2'
./release\Stack.o:Stack.cpp:(.text+0x2e0): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x328): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x36c): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x3d4): undefined reference to `vtable for Stack'
./release\Stack.o:Stack.cpp:(.text+0x4bc): undefined reference to `vtable for Stack'
collect2: ld returned 1 exit status
To copy to clipboard, switch view to plain text mode
I'm sure MOC is being invoked, it's compiliing moc_Stack.cpp. What is going on? This error has popped up before randomly and I fixed it by adding the file to the pro file, and it's definitely in the pro file. Here is Stack.h:
/*
* Stack.h
*
* Created on: Feb 27, 2010
* Author: Eric
*/
#include <QAbstractItemModel>
#include <QTableView>
#include "math/DNumber.h"
#include "stacktabwidget.h"
#ifndef STACK_H_
#define STACK_H_
Q_OBJECT
public:
Stack
(QTableView *stw,
int dplaces,
int accuracy
);
~Stack();
// functions overridden from QAbstractItemModel
QVariant headerData
( int section, Qt
::Orientation orientation,
int role
= Qt
::DisplayRole ) const;
private:
// internal settings
int mDecimalPlaces;
int mAccuracy;
// get & set
public slots:
void setDecimalPlaces(int i);
void setAccuracy(int i);
};
#endif /* STACK_H_ */
/*
* Stack.h
*
* Created on: Feb 27, 2010
* Author: Eric
*/
#include <QAbstractItemModel>
#include <QTableView>
#include "math/DNumber.h"
#include "stacktabwidget.h"
#ifndef STACK_H_
#define STACK_H_
class Stack : public QAbstractItemModel, public QList<DNumber> {
Q_OBJECT
public:
Stack(QTableView *stw, int dplaces, int accuracy);
~Stack();
// functions overridden from QAbstractItemModel
QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
QModelIndex parent ( const QModelIndex & index ) const;
int columnCount ( const QModelIndex & parent = QModelIndex() ) const;
int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
private:
// internal settings
int mDecimalPlaces;
int mAccuracy;
QTableView *mTableView;
// get & set
public slots:
void setDecimalPlaces(int i);
void setAccuracy(int i);
};
#endif /* STACK_H_ */
To copy to clipboard, switch view to plain text mode
I've implemented all the functions.
Bookmarks