Sign in to follow this  
MrBob1337

[Visual C++] Error with class members

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this