1> TestMenu.cpp
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(14): error C2208: 'void' : no members defined using this type
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(15): error C2059: syntax error : '('
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(15): error C2238: unexpected token(s) preceding ';'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(18): error C2039: 'buildMenu' : is not a member of '`global namespace''
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(18): error C2535: 'void <unnamed-tag>::buildMenu(void)' : member function already defined or declared
1> c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(17) : see declaration of '<unnamed-tag>::buildMenu'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(20): warning C4094: untagged 'class' declared no symbols
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\testmenu.cpp(6): error C2065: 'BANK' : undeclared identifier
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\testmenu.cpp(10): error C2065: 'BANK' : undeclared identifier
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\testmenu.cpp(10): error C2228: left of '.buildMenu' must have class/struct/union
1> type is ''unknown-type''
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\testmenu.cpp(12): error C2065: 'BANK' : undeclared identifier
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\testmenu.cpp(12): error C2228: left of '.processInput' must have class/struct/union
1> type is ''unknown-type''
1> MenuBuilder.cpp
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(14): error C2208: 'void' : no members defined using this type
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(15): error C2059: syntax error : '('
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(15): error C2238: unexpected token(s) preceding ';'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(18): error C2039: 'buildMenu' : is not a member of '`global namespace''
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(18): error C2535: 'void <unnamed-tag>::buildMenu(void)' : member function already defined or declared
1> c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(17) : see declaration of '<unnamed-tag>::buildMenu'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(20): warning C4094: untagged 'class' declared no symbols
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(4): error C2589: '(' : illegal token on right side of '::'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(4): error C2059: syntax error : '::'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(5): error C2143: syntax error : missing ';' before '{'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(5): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(10): error C2611: '(' : illegal following '~' (expected identifier)
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(10): error C2062: type 'void' unexpected
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(10): error C2059: syntax error : ')'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(11): error C2143: syntax error : missing ';' before '{'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(11): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(15): error C2039: 'buildMenu' : is not a member of '`global namespace''
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(30): error C2039: 'processInput' : is not a member of '`global namespace''
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(44): error C2181: illegal else without matching if
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(53): error C2181: illegal else without matching if
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Generally it's a good idea to fix the very first error in the list - most of the others will be caused by that one confusing the compiler on subsequent lines.
So, the 1st error is telling you it doesn't like the 'void' in the constructor definition, menubuilder.h line 14. Try taking it out and see if that works.
Did it fix the first compilation error? Now move on to the next one and fix that. It might not be obvious at a quick glance that the error messages have changed, but I think they will have.
Can you repost the error list with the 'void' removed?
You'll also have to remove this line from the MenuBuilder class declaration in menubuilder.h
void MenuBuilder::buildMenu();
The class qualifier (before the ::) is only used in the CPP file for the actual body definition of the method. You already have the method prototype declaration on the previous line.
1> MenuBuilder.cpp
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(16): error C2059: syntax error : '('
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(16): error C2238: unexpected token(s) preceding ';'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.h(20): warning C4094: untagged 'class' declared no symbols
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(4): error C2589: '(' : illegal token on right side of '::'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(4): error C2059: syntax error : '::'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(5): error C2143: syntax error : missing ';' before '{'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(5): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(10): error C2611: '(' : illegal following '~' (expected identifier)
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(10): error C2062: type 'void' unexpected
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(10): error C2059: syntax error : ')'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(11): error C2143: syntax error : missing ';' before '{'
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(11): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(15): error C2039: 'buildMenu' : is not a member of '`global namespace''
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(30): error C2039: 'processInput' : is not a member of '`global namespace''
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(44): error C2181: illegal else without matching if
1>c:\users\610pawn\documents\visual studio 2010\projects\lab6\lab6\menubuilder.cpp(52): error C2181: illegal else without matching if
1> Generating Code...
I removed that! I did see that error last minute. The error did change somewhat.
OK, I just saw what the problem is.
MenuBuilder.h has the following:
#define MenuBuilder
That defines a macro "MenuBuilder" as an empty string. From that point on, wherever "MenuBuilder" appears in your code, it's replaced with an empty string.
The #pragma once line performs the functionality for you anyway, so just remove the #ifndef, #define and related #endif lines.
What do you notice about line 4? What does it have that shouldn't be there? Clue: the error message is saying that member function redeclaration is not allowed. Redeclaration, not definition.
THANKS! Oh ok it's the ";" in the part. The only thing I keep deleting and retyping is the if else statements says expecting a statement. Is it the matter of spacing or too much information on lines: 44 and 52
NEVERMIND I JUST MADE ANOTHER IF STATEMENT. THANKS EVERYONE FOR ALL THE HELP!!