You've got an extraneous closing curly brace on line 19 - the indentation should have tipped you off, and the error should have hit the nail on the head. Now you know ;)
Now that I did that I am getting the error ".text+0x18): undefined reference to 'main'
collect2: error: ldd returned 1 exit status" whenever I try to compile my WebCounter.cpp using the g++ command.
Okay I deleted the extraneous "}" in the .h file and a bunch of errors come up that says my Webcounter has not been declared in lines 5,6,11,12,16,17,21,22,26,27.
Oh my God, I can't believe I missed this: the class is called name, but your functions refer to class Webcounter. Change the name of the class to Webcounter.
I believe the -o switch is used for linking, which won't work because you don't have a main function. By adding a main function to the Webcounter.cpp file, I can compile with no issues:
As i said in your other post, remove lines 3 and 4 from your header file. They aren't necessary for that particular file. There is nothing wrong with including <iostream> in the header file, may be it is my personal preference to include files where they are needed, rather than in another header file.
Line 4 is a bad habit (best to break out of it early). Instead put std:: before each std thing. So in your .cpp file have std::cout, and std::endl
Would it be better to have a main.cpp file to create a Webcounter object in, and use it's interface from there?
As already mentioned by Danny, make you class name exactly the same as the files it is in. That is Webcounter
It is also a good idea to use a high level of warnings when compiling. I routinely use -Wall -Wextra -pedantic. You could also use -Werror to promote all warnings to errors. Have a look at your compiler documentation - there are some warnings that still aren't enabled by those mentioned, and you might find these useful when compiling from the shell as opposed to an IDE: -Wmissing-include-dirs, -Wswitch-default, -Wuninitialized, -Wfloat-equal, -Wconversion
I don't use these routinely because, either my IDE warns me in the editor, or I know never to code that way - for example FP equality .