In file included from LocationData.h:11:0,
from PointTwoD.h:12,
from PointTwoD.cpp:9:
MissionPlan.h:22:2: error: ‘PointTwoD’ does not name a type
MissionPlan.h:23:2: error: ‘PointTwoD’ does not name a type
MissionPlan.h:24:14: error: ISO C++ forbids initialization of member ‘counter’ [-fpermissive]
MissionPlan.h:24:14: error: making ‘counter’ static [-fpermissive]
MissionPlan.h:24:14: error: ISO C++ forbids in-class initialization of non-const static member ‘counter’
MissionPlan.h:26:2: error: ‘LocationData’ does not name a type
MissionPlan.h:33:2: error: ‘LocationData’ does not name a type
MissionPlan.h:34:13: error: ‘LocationData’ has not been declared
PointTwoD.cpp:27:5: error: ‘pointTwoD’ has not been declared
PointTwoD.cpp: In function ‘int getY()’:
PointTwoD.cpp:29:9: error: ‘y’ was not declared in this scope
PointTwoD.cpp: At global scope:
PointTwoD.cpp:32:14: error: prototype for ‘LocationData PointTwoD::getLocationData(int, int)’ does not match any in class ‘PointTwoD’
PointTwoD.h:34:15: error: candidate is: LocationData PointTwoD::getLocationData()
In file included from LocationData.h:11:0,
from PointTwoD.h:12,
from LocationData.cpp:2:
MissionPlan.h:22:2: error: ‘PointTwoD’ does not name a type
MissionPlan.h:23:2: error: ‘PointTwoD’ does not name a type
MissionPlan.h:24:14: error: ISO C++ forbids initialization of member ‘counter’ [-fpermissive]
MissionPlan.h:24:14: error: making ‘counter’ static [-fpermissive]
MissionPlan.h:24:14: error: ISO C++ forbids in-class initialization of non-const static member ‘counter’
MissionPlan.h:26:2: error: ‘LocationData’ does not name a type
MissionPlan.h:33:2: error: ‘LocationData’ does not name a type
MissionPlan.h:34:13: error: ‘LocationData’ has not been declared
LocationData.cpp:105:7: error: prototype for ‘float LocationData::computeCivIndex()’ does not match any in class ‘LocationData’
LocationData.h:45:8: error: candidate is: float LocationData::computeCivIndex(std::string, int, int, float, float)
In file included from LocationData.h:11:0,
from PointTwoD.h:12,
from MissionPlan.h:11,
from MissionPlan.cpp:1:
MissionPlan.h:22:2: error: ‘PointTwoD’ does not name a type
MissionPlan.h:23:2: error: ‘PointTwoD’ does not name a type
MissionPlan.h:24:14: error: ISO C++ forbids initialization of member ‘counter’ [-fpermissive]
MissionPlan.h:24:14: error: making ‘counter’ static [-fpermissive]
MissionPlan.h:24:14: error: ISO C++ forbids in-class initialization of non-const static member ‘counter’
MissionPlan.h:26:2: error: ‘LocationData’ does not name a type
MissionPlan.h:33:2: error: ‘LocationData’ does not name a type
MissionPlan.h:34:13: error: ‘LocationData’ has not been declared
In file included from MissionPlan.cpp:1:0:
MissionPlan.h:15:7: error: redefinition of ‘class MissionPlan’
MissionPlan.h:15:7: error: previous definition of ‘class MissionPlan’
MissionPlan.cpp:3:27: error: variable or field ‘TopFive’ declared void
MissionPlan.cpp:3:27: error: ‘list’ was not declared in this scope
MissionPlan.cpp:3:41: error: expected primary-expression before ‘>’ token
MissionPlan.cpp:3:44: error: ‘clist’ was not declared in this scope
In file included from MissionPlan.h:11:0,
from LocationData.h:11,
from main.cpp:4:
PointTwoD.h:23:2: error: ‘LocationData’ does not name a type
PointTwoD.h:34:2: error: ‘LocationData’ does not name a type
PointTwoD.h:35:23: error: ‘LocationData’ has not been declared
In file included from LocationData.h:11:0,
from main.cpp:4:
MissionPlan.h:24:14: error: ISO C++ forbids initialization of member ‘counter’ [-fpermissive]
MissionPlan.h:24:14: error: making ‘counter’ static [-fpermissive]
MissionPlan.h:24:14: error: ISO C++ forbids in-class initialization of non-const static member ‘counter’
MissionPlan.h:26:2: error: ‘LocationData’ does not name a type
MissionPlan.h:33:2: error: ‘LocationData’ does not name a type
MissionPlan.h:34:13: error: ‘LocationData’ has not been declared
In file included from main.cpp:6:0:
MissionPlan.h:15:7: error: redefinition of ‘class MissionPlan’
MissionPlan.h:15:7: error: previous definition of ‘class MissionPlan’
LocationData.cpp:105:7: error: prototype for ‘float LocationData::computeCivIndex()’ does not match any in class ‘LocationData’
LocationData.h:45:8: error: candidate is: float LocationData::computeCivIndex(int, float, float, int, int)
In file included from MissionPlan.cpp:2:0:
MissionPlan.h:34:14: error: ISO C++ forbids initialization of member ‘counter’ [-fpermissive]
MissionPlan.h:34:14: error: making ‘counter’ static [-fpermissive]
MissionPlan.h:34:14: error: ISO C++ forbids in-class initialization of non-const static member ‘counter’
MissionPlan.cpp: In member function ‘void MissionPlan::showEntry()’:
MissionPlan.cpp:50:33: error: no match for ‘operator=’ in ‘((MissionPlan*)this)->MissionPlan::dataStore[MissionPlan::counter] = LocationData::toString()()’
MissionPlan.cpp:50:33: note: candidate is:
PointTwoD.h:19:7: note: PointTwoD& PointTwoD::operator=(const PointTwoD&)
PointTwoD.h:19:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const PointTwoD&’
1> LocationData.cpp:105:7: error: prototype for ‘float LocationData::computeCivIndex()’ does not match any in class ‘LocationData’
You have this declared in LocationData float computeCivicIndex(string, int, int, float, float); but you implement computeCivIndex()
2 > MissionPlan.h:34:14: error: ISO C++ forbids initialization of member ‘counter’ [-fpermissive]
In MissionPlan header you have this int counter=0; this is illegal. Write it like int counter; Then inside the constructor for MissionPlan do... counter = 0; (Really you should use member initialize list to get in the habit of it.)
3 > MissionPlan.cpp: In member function ‘void MissionPlan::showEntry()’:
MissionPlan.cpp:50:33: error: no match for ‘operator=’ in ‘((MissionPlan*)this)->MissionPlan::dataStore[MissionPlan::counter] = LocationData::toString()()’
You need to overload the assignment operator for pointTwoD
LocationData.cpp:107:7: error: prototype for ‘float LocationData::computeCivIndex()’ does not match any in class ‘LocationData’
LocationData.h:45:8: error: candidate is: float LocationData::computeCivIndex(int, int, int, float, float)
MissionPlan.cpp:6:2: error: ‘counter’ does not name a type
MissionPlan.cpp: In member function ‘void MissionPlan::showEntry()’:
MissionPlan.cpp:50:33: error: no match for ‘operator=’ in ‘((MissionPlan*)this)->MissionPlan::dataStore[((MissionPlan*)this)->MissionPlan::counter] = LocationData::toString()()’
MissionPlan.cpp:50:33: note: candidate is:
PointTwoD.h:19:7: note: PointTwoD& PointTwoD::operator=(const PointTwoD&)
PointTwoD.h:19:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const PointTwoD&’
I have a typo error in 1> and have change to computeCivIndex but same error.
1> Yes you not only had a typo in that one (which I did not point out), you also had different signatures for those functions. e.g. One takes void params computeCivicIndex() and the other takes 5 params computeCivicIndex(int, int, int, float, float) ... this is what you need to fix here.
3> In MissionPlan.cpp Line 50 you try to do this... dataStore[counter]=ld.toString();
dataStore is an array of PointTwoD objects. //PointTwoD dataStore[]; Which means that dataStore[counter] is an object of type PointTwoD. ld is a LocationData Object, you call ld.toString() which returns a string object. You have no assignment operator for PointTwoD that takes a type string.
You do not have this:
1 2 3 4 5
PointTwoD& operator=(const std::string &src)
{
//Handle assigning string to members of PointTwoD...
return *this;
}