Results 1 to 2 of 2

Thread: identifier not found

  1. #1
    Join Date
    Feb 2015
    Posts
    21
    Thanks
    2

    Default identifier not found

    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
    Qt Code:
    1. #ifndef PARSER_H
    2. #define PARSER_H
    3.  
    4. #include <QFile>
    5. #include <QTextStream>
    6. #include <QString>
    7. #include <QTextStream>
    8. #include <QMessageBox>
    9. #include <QDebug>
    10. class parser : public QObject
    11.  
    12. {
    13. Q_OBJECT
    14. public:
    15. explicit parser(QObject *parent = 0);
    16.  
    17. void proces_line(QString line);
    18. int read_line();
    19.  
    20.  
    21. private:
    22.  
    23. };
    24.  
    25. #endif // PARSER_H
    To copy to clipboard, switch view to plain text mode 

    and the implemenation
    Qt Code:
    1. #include "parser.h"
    2.  
    3. parser::parser(QObject *parent) :
    4. QObject(parent)
    5. {
    6.  
    7.  
    8. }
    9. void parser::proces_line(QString line)
    10. {
    11. qDebug()<<"im reading";
    12. }
    13. int parser::read_line()
    14. {
    15. QFile file("C:/Qt/test/downloaded.txt");
    16.  
    17. if(!file.exists())
    18. {
    19. qDebug()<<"the file does not exist";
    20. return 1;
    21. }
    22. if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
    23. {
    24. qDebug()<<"failed to open";
    25. return 1;
    26. }
    27. QTextStream in_stream(&file);
    28. QString line=in_stream.readLine();
    29.  
    30.  
    31. while (!line.isNull())
    32. {
    33. process_line(line); ***
    34. line = in_stream.readLine();
    35. }
    36.  
    37. ;
    38. return 0;
    39. }
    To copy to clipboard, switch view to plain text mode 

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

    and main

    Qt Code:
    1. #include "mainwindow.h"
    2. #include "parser.h"
    3. #include <QApplication>
    4.  
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QApplication a(argc, argv);
    9. MainWindow w;
    10. w.show();
    11.  
    12.  
    13. parser p;
    14. p.read_line();
    15.  
    16.  
    17. return a.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 
    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

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,530
    Thanked 281 Times in 276 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: identifier not found

    In H file You have proces_line, in CPP process_line.

  3. The following user says thank you to Lesiok for this useful post:

    bikonja (1st June 2015)

Similar Threads

  1. qInstallMsgHander identifier not found
    By Guett_31 in forum Newbie
    Replies: 2
    Last Post: 3rd August 2013, 01:14
  2. Undeclared Identifier from ui_ header
    By JediSpam in forum Qt Programming
    Replies: 2
    Last Post: 25th August 2011, 16:14
  3. Dynamic objects without identifier...
    By Bill in forum Newbie
    Replies: 7
    Last Post: 18th August 2009, 15:17
  4. please help: "setupUi: identifier not found"
    By rrrrcem in forum Qt Programming
    Replies: 2
    Last Post: 7th July 2008, 09:31
  5. Replies: 3
    Last Post: 27th February 2006, 05:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.