Hello,
I have come across a compile error, which should have a very simple solution, but I cannot figure it out. I am fairly new to programming and am still getting used to OOP.
I am trying to call a function from another class. The class seems to work but I get the following errors:
1>c:\documents and settings\abrounstein\my documents\visual studio 2008\projects\roboextract\roboextract\main.cpp(12) : error C2653: 'RoboExtract' : is not a class or namespace name
1>c:\documents and settings\abrounstein\my documents\visual studio 2008\projects\roboextract\roboextract\main.cpp(12) : error C3861: 'askUser': identifier not found
Other people seem to have this error, but it is because they forgot to include the header file into the .cpp file calling the class function, but I definetly have it included.
FYI: I am programming with the Qt toolkit
main.cpp is:
#include "RoboExtract.h"
#include <QApplication>
#include <QTextStream>
#include <iostream>
#include <QDir>
using namespace std;
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
RoboExtract::askUser();
return app.exec();
}
The RoboExtract.h is:
#ifndef ROBOSEARCH_H
#define ROBOSEARCH_H
#include <QDir>
#include "RoboExtract.h"
class RoboExtract
{
public:
RoboExtract(void);
bool readFiles(QDir directory, QString parameter);
bool askUser();
~RoboExtract(void);
};
#endif
The relevent code for RoboExtract.cpp is:
#include "RoboExtract.h"
#include <QApplication>
#include <QTextStream>
#include <iostream>
#include <QDir>
using namespace std;
...
bool RoboExtract::readFiles(QDir directory, QString parameter)
{
return true;
}
bool RoboExtract::askUser()
{
...
return readFiles(directory, parameter);
}
.... I've tried everything I could think of, I just don't have quite enough experience to figure out what to try next.
Any suggestions would be greatly appriciated! Thanks!!!