EDIT: Apparently the question is not clearly formulated enough. The issue I am having is that when the destructor is defined in the header it gets added into multiple .obj files and the linker complains. The actual question is:

When I add the destructor to a CPP file in a DLL project and use the dll with dynamic loading and the interface header file, does the base destructor still get called to prevent leaking memory?

I am using MSVC 10.0 and have a DLL project that implements an interface. The interface is an abstract (pure virtual) base class. The idea is that the header is used with dynamic loading of the library. Therefore, I have used a pure virtual destructor to make sure the destructor in the base class gets called. Here is sample code to explain this:

```
//ISplitter.h
#pragma once

struct param {
    int something;
}

class ISplitter {
public:
    virtual ~ISplitter() = 0;
    virtual void useful() = 0;
}

ISplitter::~ISplitter() {
    /* Make sure base class destructor gets called */
}

```

And the main implementation header

```
//CSplitter.h
#pragma once
#include "CHelper.h"
#include "ISplitter.h"

class CSplitter : public ISplitter {
private:
    CHelper hlp;
public:
    ~CSplitter();
    void useful();
}

```

Some helper class

```
//CHelper.h
#pragma once
#include "ISplitter.h" // I need the struct

// Class definition should go here but is irrelevant

```

Now the problem is that the linker generates an error that tells me the destructor: ISplitter::~ISplitter(void) has been multiply declared and the system will not build.
Error:

```
CHelper.obj : error LNK2005: "public: virtual __cdecl ISplitter::~ISplitter(void)" (??1ISplitter@@UEAA@XZ) already defined in CSplitter.obj

```

What is the correct way to fix this? I have placed the destructor in ISplitter.cpp, but I am worried this may not work if I dynamically load the library and upcast the base class to ISplitter.