• Advertisement
Sign in to follow this  

[Visual C++] Error with class members

This topic is 3317 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

I'm making a game with Irrlicht, but I have a problem. I have a class split between a .h and a .cpp file. The .h has inclusion guards, and I have properly included them in all I need to. However, when I compile them, I get this.
1>c:\users\hp_user\oldadam\projects\base\bmap.cpp(21) : error C2511: 'LevelData::LevelData(void)' : overloaded member function not found in 'LevelData'
1>        c:\users\hp_user\oldadam\projects\base\bmap.h(40) : see declaration of 'LevelData'
BMap.h

//2008 Binary Systems Studios
#ifndef BMAP_H
#define BMAP_H

#include <irrlicht.h>

#pragma comment(lib, "Irrlicht.lib")


using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#endif



class LevelData 
{
public:
	LevelData(ISceneManager* smgr);
	LevelData(IAnimatedMeshSceneNode * sNode);
	LevelData(IAnimatedMeshSceneNode * sNode, scene::ITriangleSelector* selector );
	
	IAnimatedMeshSceneNode * GetNode();

private:
	IAnimatedMeshSceneNode * mapNode;
	scene::ITriangleSelector* selector;

};
	





#endif 


BMap.cpp


//2008 Binary Systems Studios
//Contains implementations of level-related functions and classes

#include <irrlicht.h>

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#endif

#include "BMap.h"

using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

LevelData::LevelData()
{
	this->mapNode = mapNode;
	this->selector = selector
	
}

LevelData::LevelData(IAnimatedMeshSceneNode * sNode)
{
	this->mapNode = sNode;
	this->selector = selector;
}

LevelData::LevelData(IAnimatedMeshSceneNode * sNode, scene::ITriangleSelector* sSelector)
{
	this->mapNode = sNode;
	this->selector = sSelector;
}

IAnimatedMeshSceneNode * LevelData::GetNode()
{
	return this->mapNode;
}




What am I doing wrong, and how can I fix it?

Share this post


Link to post
Share on other sites
Advertisement
You haven't defined the constructor LevelData() in your class definition. So add it to BMap.h

Edit:

And you have defined LevelData(ISceneManager* smgr) but haven't implemented in in BMap.cpp. So perhaps you mixed them up?

Share this post


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

  • Advertisement