• Advertisement
Sign in to follow this  

VC++ problem with define directive

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

Hello, I have a .h file with the following definition:

#include "CObject.h"
#include "IRenderComponent.h"

class StaticMeshComponent : public IRenderComponent, public CObject

	virtual void Render();


and CObject.h looks like this:
#ifndef __COBJECT_H
#define __COBJECT_H

#include "Core.h"
#include <string>

typedef std::string ClassName;
class CObject;

#define DECLARE_COBJECT_BASE_CLASS(_CClass_)  protected:     ClassName m_ClassName;


When compiling though, I get this error (Visual Studio 08): Compiling... StaticMeshComponent.cpp h:\code\parallax\inc\rendercomponents.h(9) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int h:\code\parallax\inc\rendercomponents.h(9) : warning C4183: 'REGISTER_COBJECT_BASE_CLASS': missing return type; assumed to be a member function returning 'int' It seems like in RenderComponents, it thinks that DECLARE_COBJECT_BASE_CLASS is declaring a function, when it is defined in CObject.h which is included in RenderComponents.h I have a feeling this is an easy fix, but for some reason its had me stumped for a bit. Any help == greatly appreciated

Share this post

Link to post
Share on other sites
You defined a function like macro named DECLARE_COBJECT_BASE_CLASS. And then you used REGISTER_COBJECT_BASE_CLASS. These two identifiers are not the same.

Share this post

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

  • Advertisement