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
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.
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.
#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.