PDA

View Full Version : identifier not found



bikonja
1st June 2015, 13:39
Hello,

i have a slight problem and i think im just missing something obvious here, so instead of pulling my hair out i decided to ask for help


this is my class declaration

#ifndef PARSER_H
#define PARSER_H

#include <QFile>
#include <QTextStream>
#include <QString>
#include <QTextStream>
#include <QMessageBox>
#include <QDebug>
class parser : public QObject

{
Q_OBJECT
public:
explicit parser(QObject *parent = 0);

void proces_line(QString line);
int read_line();


private:

};

#endif // PARSER_H


and the implemenation

#include "parser.h"

parser::parser(QObject *parent) :
QObject(parent)
{


}
void parser::proces_line(QString line)
{
qDebug()<<"im reading";
}
int parser::read_line()
{
QFile file("C:/Qt/test/downloaded.txt");

if(!file.exists())
{
qDebug()<<"the file does not exist";
return 1;
}
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
qDebug()<<"failed to open";
return 1;
}
QTextStream in_stream(&file);
QString line=in_stream.readLine();


while (!line.isNull())
{
process_line(line); ***
line = in_stream.readLine();
}

;
return 0;
}


*** this is where i get a C3861: 'process_line)':identifier not found

and main



#include "mainwindow.h"
#include "parser.h"
#include <QApplication>


int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();


parser p;
p.read_line();


return a.exec();
}

im trying to build a class (just a skeleton code) to parse my txt file (need to grab some specific information from it)
so some tips would also be welcome if you spot something.

thx in advance

Lesiok
1st June 2015, 14:05
In H file You have proces_line, in CPP process_line.