Question: I think it's important to note that this compiles fine on Visual Studio 2012, but not in g++. It evened compiled fine at one point before I implemented RSA.cpp. I haven't touched the header files since. The error is:

```
cipher.o: In function `RSA_433::RSA_433()':
/home/andrew/Desktop/ciphers/RSA.h:18 undefined reference to `vtable for RSA_433'
collect2: error: ld returned 1 exit status

```

Here's RSA.h:

```
class RSA_433: public CipherInterface
{

public:

    RSA_433(){}
    virtual bool setKey(const unsigned char* key);

    virtual unsigned char* encrypt(const unsigned char* plaintext);

    virtual unsigned char* decrypt(const unsigned char* ciphertext);

protected:

    RSA* RSAkey;
    const char* keyFileName;
};

```

and RSA.cpp:

```
//RSA_433::RSA_433(){}  removed

bool RSA_433::setKey(const unsigned char* key){//body}

unsigned char* RSA_433::encrypt(const unsigned char* plaintext){//body}

unsigned char* RSA_433::decrypt(const unsigned char* ciphertext){//body}

```

RSA.h also inherits from: 

```
class CipherInterface
{
public:

    CipherInterface(){}

    virtual bool setKey(const unsigned char* key){ return false;  }

    virtual unsigned char* encrypt(const unsigned char* plaintext){ return NULL; }

    virtual unsigned char* decrypt(const unsigned char* ciphertext) { return NULL; }

};

```

Answer: 
You seem to have two definitions for `RSA_433::RSA_433()`. One in the `.h` file and one in the `.cpp` file

Also, all the methods defined in class `CipherInterface` are inline. According to [GCC standard](https://gcc.gnu.org/faq.html#vtables),

> 
> The ISO C++ Standard specifies that all virtual methods of a class
>  that are not pure-virtual must be defined, but does not require any
>  diagnostic for violations of this rule [class.virtual]/8. Based on
>  this assumption, GCC will only emit the implicitly defined
>  constructors, the assignment operator, the destructor and the virtual
>  table of a class in the translation unit that defines its first such
>  non-inline method
> 
> 
> 

That means GCC will only include vftable in the object file for the translation unit where the definition of the first non-pure, and non-inline virtual member function is present. If there is no such definition, vftable will not be included for the class.
The answer is simple: You should add and implement a virtual destructor in `CipherInterface` and the problem will go away.