提问人:Bob Penoyer 提问时间:11/7/2020 最后编辑:0xdwBob Penoyer 更新时间:11/9/2020 访问量:455
项目迁移后未解决的外部问题
Unresolved External After Project Migration
问:
我正在使用 C++ Builder 10.4.1。我迁移了一个包含 3 个表单的简单项目。主窗体包含一个 .当我尝试编译时,出现以下错误:TDriveComboBox
[ilink32 Error] Error: Unresolved external 'Vcl::Filectrl::TDriveComboBox::' referenced from (then it lists the path to the main form's OBJ file)
[ilink32 Error] Error: Unresolved external '__fastcall Vcl::Filectrl::TDriveComboBox::GetDrive()' referenced from (then it lists the path to the main form's OBJ file)
我什至尝试删除并替换它,但这无济于事。
问题是什么,我该如何解决?TDriveComboBox
答:
我会:
- 删除所有临时文件(obj,exe,TDS,...)
- 在有此问题的表单上添加新的临时工
TDriveComboBox
- 编译并运行。
如果这没有帮助,那么有时手动将组件包含在表单文件中的 VCL 标头有助于重置编译器/链接器,因此请在 VCL inc 文件夹中搜索 In mine system its in here:#include
*.h
TDriveComboBox
c:\Program Files (x86)\Borland\BDS\4.0\include\vcl\FileCtrl.hpp
因此,添加如下内容:
#include <FileCtrl.hpp>
或
#include <vcl\\FileCtrl.hpp>
添加到您的表单文件中...但即使这样有时也会失败。根据我的经验,问题出在项目文件(或较新版本获得的任何扩展名)中,因此最好在编译器正常工作时备份它......因为它有时会自我破坏,尤其是对于大型项目。*.h
*.bds, *.bdsproj, ...
有时,如果您移动,也会有所帮助:
#pragma hdrstop
行到不同的位置(几行向下或向上)。如果幸运的话,它还可以重置编译器/链接器,之后您可以将其移动到原始位置。然而,这只是偶尔有帮助(如1:20)。而且您还需要尝试几个位置
如果没有任何效果,只需创建新的空项目并将表单和内容复制到其中并将其添加到项目中......每个表单都有 3 个文件 (),如果应用程序使用的所有第三方自定义内容没有直接链接,请不要忘记将您需要的任何内容 (DLL *.lib,...) 添加到您的项目中*.h,*.cpp,*.dfm
#pragma link
曾经(也是在从 BCB5 迁移到 BDS2006 之后),即使这对我的一个项目也没有帮助。我被迫创建表单(包含所有组件但没有功能,只需将它们放在表单上),然后从旧应用程序中复制内容......但是,如果您拥有太多组件,那将是一件痛苦的事情......
评论
I have found for most of these problems created by the ide in converting my 10.3.3 projects to 10.4.1 can be solved by an annoying process as described below:
- open the form.
- on design tab, switch to text view.
- switch to form veiw.
- under project, recompile just the form.
- now run project.
This has solved most of my unresolved's except _CG_*.
评论