Hi all, I'm a novice C++ programmer (main language is java). I'm getting a C2504: base class undefined error, and have no idea why. Google told me this happens when the base class is indeed not defined before a class inheriting from the base class is defined, but this does not seem to be the problem here.
and Intersectable.h looks like:
other unrelated tips on the code style are welcome too :) I'm using visual studio 2010
Code:
#ifndef GEOMETRY
#define GEOMETRY
#include "stdafx.h"
#include "Intersectable.h"
#include "HitRecord.h"
#include "Ray.h"
#include "BRDF.h"
class Intersectable;
class brdf;
class HitRecord;
class Geometry: public Intersectable {
public:
virtual ~Geometry(){}
virtual bool intersect(const Ray &ray, HitRecord* record) = 0;
brdf *brdf;
};
#endif
Code:
#ifndef INTERSECTABLE
#define INTERSECTABLE
#include "stdafx.h"
#include "Ray.h"
#include "HitRecord.h"
class HitRecord;
class Ray;
class Intersectable{
public:
virtual ~Intersectable(){}
virtual bool intersect(const Ray &ray, HitRecord *record) = 0;
};
#endif
Comment