Howdy all,
I'm trying to create a constructor for a custom type, but for some reason, it's trying to call, what I'm guessing is the constructor in the constructor definition of anotehr class.. Couldn't find anything which fits the same symptoms I'm having in any other questions, also as I may not know what I'm looking for.
When I call:
LatLngBounds clusterBounds(&boundsNorthEast, &boundsSouthWest);
in main.cpp, in LatLngBounds.cpp I get "No matching funciton for call to 'LatLng:LatLng()" thrown twice on the line for:
LatLngBounds::LatLngBounds(LatLng &newSouthWest, LatLng &newNorthEast)
Anyone got any ideas?
Drew J. Sonne.
IDE: Xcode 3.2 (Targeted to Debug 10.5)
OS: OSX 10.6
Compiler: GCC 4.2
Arch: x86_64
main.cpp:
std::vector<std::string> argVector;
... fill up my argVector with strings..
vector<double> boundsVector = explodeStringToDouble(argVector[i]);
LatLng boundsNorthEast(0, boundsVector[0], boundsVector[1]);
LatLng boundsSouthWest(0, boundsVector[2], boundsVector[3]);
LatLngBounds clusterBounds(&boundsNorthEast, &boundsSouthWest);
LatLngBounds.h
#ifndef __LATLNGBOUNDS
#define __LATLNGBOUNDS
#include "LatLng.h"
class LatLngBounds {
private:
LatLng northEast;
LatLng southWest;
public:
LatLngBounds(LatLng&,LatLng&);
};
#endif
LatLngBounds.cpp
#include "LatLngBounds.h"
#include "LatLng.h"
LatLngBounds::LatLngBounds(LatLng &newSouthWest, LatLng &newNorthEast)
{
this->southWest = newSouthWest;
this->northEast = newNorthEast;
};
LatLng.h
#ifndef __LATLNGDEF
#define __LATLNGDEF
class LatLng {
public:
LatLng(int,double,double);
private:
double lat, lng;
int id;
};
#endif
LatLng.cpp
#include "LatLng.h"
LatLng::LatLng(int newId, double newLat, double newLng)
{
/* Grab our arguments */
id = newId;
lat = newLat;
lng = newLng;
};