Hi,
I am so frustrated by this error and I don't know how to solve it. Hope someone helps!

I have a dynamic lib (Call it D) which is loaded at runtime with the dlopen() function inside a static lib (Call it S). There is a header file that contains all the interfaces required to access things passed to outside from D.
I have two interfaces (Call them I1 and I2) that are defined in the header. I acquire an I1* from D (This is done inside S) and the do a dynamic cast to I2*.

Now I use S inside my main program and S in turn is responsible for loading D and doing the above mentioned dynamic cast. It all compiles ok but gives me a linker error:

Undefined symbol:
typeinfo for I2

How do I solve this?

Recommended Answers

All 2 Replies

Oh I figured it out.
So happens that I had an undefined destructor:

class I1
{
virtual I1();
};

Should have been:

class I1
{
virtual I1(){};
};

Okay, if you've figured it out, then it's better to mark this thread as solved.

But before you do, I want to give my opinion on the use of the following name in your code: I1.
IMO (= In my opinion) you shouldn't use names like this, I only get frustrated by seeing such one, the I and directly after it a 1, they don't seem to be good friends of each other.

But if you've no problems with this name, then you just do what you want.
I only wanted to let you know, so please feel free if you want to ignore my advice if you don't care about it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.