Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

DLLs & Virtual Functions

$
0
0

I have the following base and derived class that are in a dll and that I need to export so they are accessible in a program that consumes the dll.

class MY_DLLAPI CBase {
public:
   virtual ~CBase();
   virtual void Function1() = 0;
   static CBase* Create();
private:
   HANDLE  m_handle;
}

class MY_DLLAPI CMyClass : CBase {
   ~CMyClass();
   void Function1();
   void SomeFunction();
};

When I try to compile that I get "error LNK2001: unresolved external symbol "public: virtual __thiscall CBase::~CBase(void)" (??CBase@@UAE@XZ). I also get the same error for Function1(). Another class without virtual functions works just fine. How can I get the above working?


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>