error C2143 missing ';' before '<'

I researched this error and found a lot of posts related to this type of erros but nothing that solved my case: error C2143: syntax error : missing ';' before '<'

*.h
Set<string> matchRegExp(string exp);

*.cpp
1
2
3
4
5
6
7
Set<string> Lexicon::matchRegExp(string exp)
{
	string upperCaseWord = ConvertToUpperCase(exp);
	int pos = -1; // cntr increments through word
	Set<string> matchSet; //static
	matchRegExpHelper(root, upperCaseWord, pos, matchSet); 
	return matchSet; //returns matchSet with words 

Is Set your own class? The STL set is called std::set (lowercase).
Lexicon::

From Deepest Fathoms: Please. You must take the Lexicon. Bring it back to Avanchnzel!

(I've been playing too much Skyrim)

</unhelpful but hopefully somewhat humorous>
Last edited on
the humor is appropriate in this case,

because, Lexicon is assignment 6 in the CS class I took in 2009 and am now reusing, but it has been so long that I'd have to guess that, yes, Set is my own class. Where is the TA Alen - probably hanging out in the LaIR?

this compiled in VS2005, but 2008 and 2012BETA are not so happy with my code.
Last edited on
what does the template of your set look like?
it is the STL set ; I changed it to lowercase set< > but the compiler is still has the same error

I changed these back to uppercase Set< > and added #include "set.h" to a file that only had #include <set.h>; I hate making changes like this to find the solution without understanding the why. The errors are gone.
Last edited on
#include with double quotes ("") is a superset of #include with angled brackets (<>). It searches the directory that contains the including file before the default include paths.
set.h must have been in the same directories as your project files, and not a default include directory.
can you go to this post and continue help there http://www.cplusplus.com/forum/beginner/73049/
Topic archived. No new replies allowed.