在.obj文件中有关FreeType库类析构函数T ::〜T的未解析外部 [英] Unresolved external in .obj files concerning FreeType library class destructors T::~T

查看:248
本文介绍了在.obj文件中有关FreeType库类析构函数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 ?

...我现在遇到了另一个困难:
我现在在.obj文件中有未解决的外部损坏:
我已经看到这个错误之前:
似乎是一个虚拟衰减器的问题,应该没有实现:
T ::〜T() {} ;
(或= null;)

... 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;)

问题是有关的析构函数在FreeType库中。因此我认为它是写得很好,不愿意修改其析构函数...

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 ...

=>任何人都知道在.obj文件中析构函数中未解析的外部问题编译FreeType库?

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

推荐答案

我还没有使用FreeType,但我猜测析构函数直接在类声明中定义。这意味着它们被隐式声明为内联。根据你的编译器,这将防止析构函数被外部​​链接包含在任何生成的库文件中。

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.

现在做什么:


  • 检查您是否错过了FreeType的任何必需的库。在类UNIX操作系统上,您可以使用nm命令(参考手册页)检查nm是否析构函数代码包含在库文件中。

  • check whether you have missed any of the necessary libraries for FreeType. On Unix-like OSes, you can check with nm if the destructors code is included in a library file using the 'nm' command (refer to the man page).

检查FreeType文档是否存在已知问题或更新版本

Check the FreeType documentation whether this is a known issue or a newer version exists

更改包含这些类的头文件,使析构函数非内联并将其定义移至单独的文件:

Change the header files containing these classes, make the destructors non-inline and move their definitions to a separate file:

class A {
...
virtual〜A(){}
}

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

成为

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

并在一个单独的文件中提供:

and in a seperate file provide this:

A::~A() {}

这篇关于在.obj文件中有关FreeType库类析构函数T ::〜T的未解析外部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆