c++externaldestructorfreetypeobject-files

Unresolved external in .obj files concerning FreeType library class destructors T::~T


After having solved in a more or less good manner this problem : How to update a Borland 6 C++ Project from including indy.bpi to indy60.bpi?

... I now meet another difficulty : I now have "unresolved external" destuctors in .obj files : I have allready seen this error before : it seems to be a question of virtual destuctors that should be implemented with nothing : T::~T() { } ; (or = null;)

The problem is that the concerned destructors are in the FreeType Library. I therefore suppose it to be well-written and am reluctant to modify its destructors ...

=> Anybody knows about problems with unresolved external on destructors in .obj files while compiling FreeType Library ?


Solution

  • I have not worked with FreeType yet, but I guess the destructors are defined directly inside the class declaration. This means they are implicitly declared as inline. Depending on your compiler, this will prevent the destructors from being included with external linkage in any of the library files generated.

    What to do now:

    becomes

    class A {
      ...
      virtual ~A();
    }
    

    and in a seperate file provide this:

    A::~A() {}