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

string & HTMLParser::ParseDescription()
		{
			DescripChars getChars;
			return description;
		}

My watered down HTMLParser.h file follows:

#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

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

#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

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

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.

This article has been dead for over six months. Start a new discussion instead.