Is it possible to make some cpp classes as a dll file so that I can import this dll and use these classes?
For example, I have four files like this:
// A.h
class A
{
public:
virtual void fun();
};
//A.cpp
void A::fun()
{
// do something
}
//B.h
class B : public A
{
public:
virtual void fun();
};
//B.cpp
void B::fun()
{
// do something
}
Now, what I want to do is to generate a dll file with these four files above. Then if I have another project, I just import the dll file and use the A
and the B
immediately, such as A a; a.fun(); B b; b.fun();