Jump to content
  • Advertisement
Sign in to follow this  
silvermace

[solved] C2440 error.... wtf.

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

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]

Share this post


Link to post
Share on other sites
Advertisement
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.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!