I have a class setting, and from this class I use inheritance.
In file ah
class a
{
public:
virtual void print();
};
In the bh file:
#include "a.h"
#include <iostream>
class b: public a
{
public:
void print();
};
And in b.cpp
#include "a.h"
#include "b.h"
void b::print(){};
In the main file, I include both of these files:
#include "a.h"
#include "b.h"
However, I get an unresolved character to print a virtual function. The a.obj file is listed as the file generating the error. What am I doing wrong? If I translate b.cpp to bh below the class definition, it works fine.
source
share