Skip to main content
gamedev.net
🔒 Locked

Compile Error

Started by Greg K Oct 29, 2002 at 4:59 PM 3 replies 500+ views
Original Post
Greg K
Greg K
I get this error: ...\source\resourcetexture.h(20) : error C2504: 'Resource' : base class undefined even though I include Resource.h! I tried putting class Resource; in the resourcetexture file but it still gives me that error. Any ideas? -Greg Koreman [EDIT] I also tried putting this in the resourcetexture file: class Resource{}; and it gave me this error: ...\source\resource.h(17) : error C2011: 'Resource' : 'class' type redefinition [edited by - Greg K on October 29, 2002 6:02:52 PM]
niyaw
niyaw
you shouldn''t use "resource.h" as a filename for your code, because if you ever add a resource to your project, that file will be overwritten with an autogenerated resource.h, causing you to lose all your data, no questions asked.
Zipster
Zipster
What does resource.h look like? Are you declaring Resource in that file (or any other included file)?
Greg K
Greg K

  
/*
Aether

Name: Resource
Desc: Base class for resources
Methods:
*/


#ifndef RESOURCE_H
#define RESOURCE_H

#include "Class Names.h"
#include <string>
using namespace std;

class Resource
{
public:
// CONSTRUCTORS

Resource();
~Resource();
// INLINE FUNCTIONS

string getFilename()
{return filename;}
// FUNCTIONS

private:
// CONSTRUCTORS

// STRUCTURES

// DATA

// INLINE FUNCTIONS

// FUNCTIONS

protected:
// CONSTRUCTORS

// STRUCTURES

// DATA

string filename;
unsigned int reference;

// INLINE FUNCTIONS

void setFilename( string fnm )
{filename = fnm;}
void addReference()
{reference++;}
bool removeReference()
{if(reference==1) return true;
reference--;
return false;}
// FUNCTIONS

};

#endif


[edited by - Greg K on October 29, 2002 11:27:30 PM]

Topic Locked

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

Sign in to reply to this topic.