Object not declared in scope (didn't find answer in page)

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 2
Reputation: CollegeC++ is an unknown quantity at this point 
Solved Threads: 0
CollegeC++ CollegeC++ is offline Offline
Newbie Poster

Object not declared in scope (didn't find answer in page)

 
0
  #1
Oct 25th, 2008
The section, of my program, that has to do with the error extracts a description from an html file or site. We are to find it based on three criteria. I have two down and this third one is giving me problems. I tried to create a DescripChars object in my ParseDescription method and it comes up with this error. I am manually making a make file as I go, so I will include that too. (Our teacher wanted us to know how it worked before we used automated make files and I have not had time to learn how to use an automated one yet.)

Here is my watered down Parse Description method which is part of the HTMLParser class
[code = c++]
string & HTMLParser:arseDescription()
{
DescripChars getChars;
return description;
}
[/code]
My watered down HTMLParser.h file follows:
[code = c++]
#ifndef CS240_HTMLPARSER_H
#define CS240_HTMLPARSER_H

#include <string>
#include "BST.h"
#include "WordProcessor.h"
#include "LinkedList.h"
#include "StringUtil.h"
#include "DescripChars.h"

using namespace std;
class HTMLParser
{
private:
string description;
public:
string & ParseDescription();
};

#endif
[/code]

Now I will list my DescripChars.h file
I don't think I need to list the Descrip.cpp file so I won't do that
[code = c++]
#ifdef CS240_DescripChars_H
#define CS240_DescripChars_H

#include <string>
#include <cstring>

using namespace std;

class DescripChars
{
private:
int length;
string description;
public:
DescripChars();

void GetCharacters(string & line);

string & GetString();
};


#endif
[/code]

Here are parts of my make file:

bin/test: obj/test.o obj/PageIndex.o obj/BST.o obj/HTMLParser.o \
obj/LinkedList.o obj/LinkIterator.o obj/WordProcessor.o obj/DescripChars.o \
lib/libutils.a
g++ -g -o bin/test obj/test.o obj/PageIndex.o obj/HTMLParser.o \
obj/BST.o obj/LinkedList.o obj/LinkIterator.o obj/WordProcessor.o \
obj/DescripChars.o lib/libutils.a
chmod a+x bin/test

obj/HTMLParser.o: src/HTMLParser.cpp
g++ -g -o obj/HTMLParser.o -c -I inc -I utils/cs240utils/include \
-lboost_iostreams -lboost_program_options -lboost_filesystem src/HTMLParser.cpp

obj/DescripChars.o: src/DescripChars.cpp
g++ -g -o obj/DescripChars.o -c -I inc src/DescripChars.cpp


my .h files are in the inc folder and I am using another library that is in another folder as indicated in the HTMLParser line my .cpp files are in the src directory
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2
Reputation: CollegeC++ is an unknown quantity at this point 
Solved Threads: 0
CollegeC++ CollegeC++ is offline Offline
Newbie Poster

Re: Object not declared in scope (didn't find answer in page)

 
0
  #2
Oct 25th, 2008
H
Last edited by CollegeC++; Oct 25th, 2008 at 9:18 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 390
Reputation: skatamatic will become famous soon enough skatamatic will become famous soon enough 
Solved Threads: 39
skatamatic skatamatic is offline Offline
Posting Whiz

Re: Object not declared in scope (didn't find answer in page)

 
0
  #3
Oct 25th, 2008
Hmm please use code tags. And what was the actual question? Please post the specific part of your code that you are having issues with.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC