freekill
19th November 2009, 02:31
I'm working on my multi-threaded project and got this error on build. I did not require any initialization with my threads and I just made an instance of the thread in the private section of my QMainWindow.
error: field 'capturingThread' has incomplete type
error: field 'computingThread' has incomplete type
The following code is my main window and the error points to the private section here.
#ifndef GENIUS_H
#define GENIUS_H
#include <QMainWindow>
#include "ui_genius.h"
class CapturingThread;
class ComputingThread;
class GeniusMain : public QMainWindow, private Ui::genius
{
Q_OBJECT
public:
GeniusMain(QMainWindow *parent);
protected:
void closeEvent (QCloseEvent *event);
private slots:
void standbyThreads();
void startTransmission();
void haltThreads();
void printFPS();
void printDistance();
void printTeam();
void printOpp();
private:
CapturingThread capturingThread;
ComputingThread computingThread;
};
#endif
Here are the header files for my threads capturingThread and computingThread.
#ifndef CAPTURINGTHREAD_H
#define CAPTURINGTHREAD_H
#include <QThread>
class ImageBuffer;
class CapturingThread : public QThread
{
public:
CapturingThread();
~CapturingThread();
void haltCapture();
protected:
void run();
private:
volatile bool halt;
ImageBuffer* imageBuffer;
};
#endif
#ifndef COMPUTINGTHREAD_H
#define COMPUTINGTHREAD_H
#include <QThread>
class ImageBuffer;
class ComputingThread : public QThread
{
public:
ComputingThread();
~ComputingThread();
void haltComputing();
void startTransmitting();
void stopTransmitting();
protected:
void run();
private:
volatile bool halt;
volatile bool transmit;
ImageBuffer* imageBuffer;
};
#endif
What could be the source of the build error?
error: field 'capturingThread' has incomplete type
error: field 'computingThread' has incomplete type
The following code is my main window and the error points to the private section here.
#ifndef GENIUS_H
#define GENIUS_H
#include <QMainWindow>
#include "ui_genius.h"
class CapturingThread;
class ComputingThread;
class GeniusMain : public QMainWindow, private Ui::genius
{
Q_OBJECT
public:
GeniusMain(QMainWindow *parent);
protected:
void closeEvent (QCloseEvent *event);
private slots:
void standbyThreads();
void startTransmission();
void haltThreads();
void printFPS();
void printDistance();
void printTeam();
void printOpp();
private:
CapturingThread capturingThread;
ComputingThread computingThread;
};
#endif
Here are the header files for my threads capturingThread and computingThread.
#ifndef CAPTURINGTHREAD_H
#define CAPTURINGTHREAD_H
#include <QThread>
class ImageBuffer;
class CapturingThread : public QThread
{
public:
CapturingThread();
~CapturingThread();
void haltCapture();
protected:
void run();
private:
volatile bool halt;
ImageBuffer* imageBuffer;
};
#endif
#ifndef COMPUTINGTHREAD_H
#define COMPUTINGTHREAD_H
#include <QThread>
class ImageBuffer;
class ComputingThread : public QThread
{
public:
ComputingThread();
~ComputingThread();
void haltComputing();
void startTransmitting();
void stopTransmitting();
protected:
void run();
private:
volatile bool halt;
volatile bool transmit;
ImageBuffer* imageBuffer;
};
#endif
What could be the source of the build error?