我在Delphi BPL中有代码,想在C ++ Builder中使用它。但是,它对我不起作用。
这就是我所做的:
(1)Delphi BPL包:
package PackageNameHere;
{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO ON}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS ON}
{$RANGECHECKS ON}
{$REFERENCEINFO OFF}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION '...'}
{$IMPLICITBUILD OFF}
.........
contains
hcg_employeeAuth in 'Src\hcg_employeeAuth.pas';
(2)在包选项中,我启用了“创建所有C ++ Builder文件”
(3)在C ++ Builder表单中,应该使用代码:
#include <vcl.h>
#pragma hdrstop
....................................
#include <hcg_employeeAuth.hpp>
#pragma package(smart_init)
#pragma resource "*.dfm"
....................................
void __fastcall TDLG_Main::FileNew1Execute(TObject *Sender)
{
if (ThcgEmployeeAuth::Authentificate(__classid(ThcgEmployeeAuth))) {
// ...
}
}
(4)在C ++ Builder项目的选项中,我有
我在链接器进程中收到以下错误消息:
ILINK32错误:无法解析外部问题 由...... \ main.obj引用的'Hcg_employeeAuth :: ThcgEmployeeAuth ::'