ziplockenator
Programmer
My problem is that the code does not link, whatever I do. The code compiles fine, but I'm getting vtable and typeinfo errors. My stripped-down code is belown - can someone point out the error?
Code:
(File - "test.cc")
#include "Roads/Vehicle.h"
class test : public Roads::Vehicle {
public:
test();
bool hasExit();
int move();
};
test::test() {
}
bool test::hasExit() {
return true;
}
int test::move() {
return 3;
}
(File Roads/Vehicle.h)
# ifndef VEHICLE_H_ROADS
# define VEHICLE_H_ROADS
namespace Roads {
class Location;
class Vehicle
{
public:
Vehicle() {};
Vehicle (int, Location&) {};
~Vehicle (){};
// Does this Vehicle have a way out from its current Location?
virtual bool hasExit ();
// Give this Vehicle a chance to move, return 1 if potential collision.
virtual int move ();
};
}
# endif