Jump to content
  • Advertisement
Sign in to follow this  
Last Attacker

no matching function call to...

This topic is 4834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
In your constructors you need a capital L after the C:

CLandscape not Clandscape.

Ace

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!