Hi everyone!
I'm having a problem with my C++ project.
I'm using wx-DevC++ (4.9.9.2-wx-beta-6.7) with the MingW compiler (not sure which version) and the compiler keeps generating this error :
"no matching function call to CSelector::CSelector(CLandscape *&)"
The thing is, why the "&" if I made the CSelector constructor :
CSelector::CSelector(CLandscape *ls) ?
Here's the header of my CSelector class :
CSelector.h
#ifndef C_SELECTOR_H
#define C_SELECTOR_H
#include "../libs/utils.h"
#include "../libs/math/Vector.h"
#include "3DLandscape.h"
class CSelector
{
private:
.
.
.
CLandscape *mLandscape;
public:
CSelector(Clandscape *ls);
CSelector(Clandscape *ls, uCOLOR color);
~CSelector();
.
.
.
};
#endif //C_SELECTOR_H
3DLandscape.h
#ifndef __3DLandscape_h
#define __3DLandscape_h
#include "../libs/images/image.h"
#include "../libs/utils.h"
#include "../libs/math/Vector.h"
#include "../libs/adt/CArray.h"
#include "CObject.h"
#include "CHole.h"
#include "3DWave.h"
#pragma pack(push, CLANDSCAPE, 1)
class CLandscape : public CObject
{
public:
CLandscape();
~CLandscape();
.
.
.
private:
.
.
.
};
#pragma pack(pop, CLANDSCAPE)
#endif
And here is where the compiler issues the error:
GlcTerrain.cpp
.
.
.
GlcTerrain::GlcTerrain(wxWindow *parent, UserConfig *usr, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name)
: wxGLCanvas(parent, (wxGLCanvas*) NULL, id, pos, size, style, name )
{
.
.
.
//Over here
mSelectionBox = new CSelector(mLandscape);
.
.
.
}
.
.
.
mLandscape is a pointer of CLandscape in the GlcTerrain class.
Also, at my CSelector.cpp it says : "expected ')' before '*' token", thats the
"CSelector(CLandscape *ls)" part.
Any ideas? I hope I gave enough info. Sorry I didn't place all my code here, because its VERY LONG and I don't want everyone to see what I've done. If more is needed I could give more but I hope that this is enough for now.
Thanks