I created two header files w/ their corresponding .cpp file and one main. I created one object called Resistor_4Band Resistor4 and another called Resistor _5_Band Resistor 5. It is saying that it is not recognizing Resistor_5_Band as a type at all and keeps wanting me to replace it with Resistor_4Band.
I've included my main and two header files 4Band.h and 5Band.h. Let me know if i need to paste in my .cpp files for both headers.
Also the first error is on the line where I declared the object Resistor5. The other errors are on the lines that contain every function call belonging to Resistor5. All header files and .cpp files seem to be ok. No errors show there. main is the only place where these errors are coming up.
Errors:
1 2 3 4 5 6 7 8 9
Resistor_Trial_2 Group
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp:15:5: Unknown type name 'Resistor_5_Band'; did you mean 'Resistor_4Band'?
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp:63:23: No member named 'set_Resistor_5_Colors' in 'Resistor_4Band'
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp:64:23: No member named 'set_Resistor_5_Values' in 'Resistor_4Band'; did you mean 'Resistor4_Value'?
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp:64:44: Called object type 'float' is not a function or function pointer
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp:65:23: No member named 'calculate_Resistor_5_Value' in 'Resistor_4Band'; did you mean 'calculate_Resistor4_Value'?
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp:66:23: No member named 'print_Resistor_5_Value' in 'Resistor_4Band'
/Users/shaneyost/Desktop/NEST/XCODE FILES/Resistor_Trial_2/Resistor_Trial_2/main.cpp:67:24: Identifier 'Resistor_5_Band' in object destruction expression does not name a type
After the line #include "4Band.h" has been processed the compiler has seen your class Resistor_4Band and the macro __Resistor_Trial_2___Band__ is defined. Now when the #include "5Band.h" line is processed, because the macro is already defined, everything in 5Band.h is skipped down to the #endif statement so the compiler never sees your Resistor_5_Band class. To fix this you need to use different macros in the header guards of each file. Change one of them to something different.