Can't compile my class. Getting error: error: field 'filename' has incomplete type
If I change QString filename to QString *filename, error goes off.. but I need to have QString filename.
process.h:
#ifndef PROCESS_H
#define PROCESS_H
#include <QString>
class Process
{
public:
int pid;
QString filename;
Process(int pid, QString filename);
};
#endif // PROCESS_H
process.cpp:
#include "process.h"
Process::Process(int pid, QString filename)
{
this->pid = pid;
this->filename = filename;
}
What's wrong?
#include "process.h"and#include <QString>.