no matching function call to...

Started by
1 comment, last by Last Attacker 18 years, 8 months ago
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
"Take delight in the Lord and He will give you your heart's desires" - Psalm 37:4My Blog
Advertisement
In your constructors you need a capital L after the C:

CLandscape not Clandscape.

Ace
Awh man! Sorry, I feel stupid.
Just shows what 12 'o clock at night programming can do to you.

Thanks!
"Take delight in the Lord and He will give you your heart's desires" - Psalm 37:4My Blog

This topic is closed to new replies.

Advertisement