error C2143 missing ';' before '<'

Jun 8, 2012 at 2:56am
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 

Jun 8, 2012 at 3:11am
Is Set your own class? The STL set is called std::set (lowercase).
Jun 8, 2012 at 3:43am
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 Jun 8, 2012 at 3:43am
Jun 8, 2012 at 3:37pm
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 Jun 8, 2012 at 3:40pm
Jun 8, 2012 at 3:41pm
what does the template of your set look like?
Jun 8, 2012 at 4:03pm
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 Jun 8, 2012 at 5:54pm
Jun 8, 2012 at 9:00pm
#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.
Jun 12, 2012 at 5:27pm
can you go to this post and continue help there http://www.cplusplus.com/forum/beginner/73049/
Topic archived. No new replies allowed.