Skip to main content
gamedev.net
🔒 Locked

[solved] C2440 error.... wtf.

Started by silvermace Nov 26, 2004 at 5:25 PM 5 replies 1k views
Original Post
silvermace
silvermace
error C2440: '=' : cannot convert from 'render::MaterialManger *' to 'render::MaterialManager *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
i don't get it.. wtf?! material.hpp

#ifndef VE_MATERIAL_HPP
#define VE_MATERIAL_HPP

namespace render
{
	class ShaderGpu;
	class ShaderCpu;

	// basic material interface class
	class IMaterial : public core::IUnknown
	{
               // code removed
	};


	//--------------------------------------------------------------
	// material manager class, not singleton

	class MaterialManger : public core::IUnknown 
	{
	public:
		virtual int createMaterial( std::string materialFile );
		virtual int rebuildMaterial( std::string materialFile, int replaceID );

		virtual void loadDirectory( std::string dir );	

		virtual IMaterial* getMaterial( int id );

		virtual ~MaterialManger();
		MaterialManger();

	protected:
		std::vector< IMaterial* > materials;
	};

};




material.cpp

#include "engine.hpp"
#include "material.hpp"

namespace render
{

//---------------------------------------------------------------
MaterialManger::MaterialManger() 
	: IUnknown( "MaterialManager" )
{
}

//---------------------------------------------------------------
MaterialManger::~MaterialManger()
{
}

//// SOURCE REMOVED FROM HERE

}; //namespace



Error Line:
	if( matManager == NULL )
		matManager = new MaterialManger(); //<----
VC 7.1 2003 no SP, winxp sp2 [Edited by - silvermace on November 27, 2004 6:28:37 AM]
Qw3r7yU10p!
Qw3r7yU10p!
I'd go with the old rebuild all [smile]
SiCrane
SiCrane
I don't think you're showing enough code. If I take your code as given, throw it into MSVC 7.1 and compile I don't duplicate the error.
chollida1
chollida1
You don't actually show the line of code where the error happens. Kindof hard to decipher without it:)

Cheers
Chris
CheersChris
zaniwhoop2
zaniwhoop2
You misspelled Manager as Manger. Just change the class name, constructor, and destructor so that they're spelled right.
chollida1
chollida1
Ha, spelling is always the first thing I look at when I get compile error's, should have known:)

Cheers
Chris
CheersChris

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.